egit - 向上游推送新分支

标签 egit

我在 Github 上有一个本地仓库和一个远程仓库。我刚刚创建了两个新的本地分支,DocumentationDevelopment,使用 origin/master 作为上游源。

我如何将这些新分支推送到上游。我尚未对新分支进行任何更改,因此没有新内容,只有分支本身。

现在我想创建一个使用 origin/Development 作为上游的新主题分支,但目前还没有。

最佳答案

您不需要在分支上进行任何新提交即可进行推送。在远程创建和跟踪相应分支的关键是使用 --set-upstream 标志。

$ git checkout -b Documentation
$ git push --set-upstream origin Documentation

短旗形式:

$ git checkout -b Documentation
$ git push -u origin Documentation

关于egit - 向上游推送新分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46131576/

相关文章:

java - 为什么 org.eclipse.egit.github.core API 上的字段 "language"返回 null 到所有存储库?

windows - 如何让 git 停止更改文件中的换行符?

Eclipse Egit 具有深色背景,仍然有黑色文本

eclipse - 错误 "EGit could not detect where Git is installed"是什么意思?

eclipse - Git 和 egit 关于文件模式 10064 的冲突,尽管文件模式设置为 false

git - 不 merge

git - Eclipse Egit 无法登录 Bitbucket

Eclipse eGit : History view only shows local history, 不是远程历史记录

eclipse - "git pull --rebase"在 Eclipse 中

java - 多次尝试修复 : Malformed input or input contains unmappable chacraters 后,Eclipse 中出现连续 Git 错误