【发布时间】:2016-02-22 22:25:45
【问题描述】:
我的沙盒存储库中有一个名为local-branch 的本地分支,它跟踪一个名为remote-branch 的远程分支。我因此创建了本地分支:
$ git checkout -b local-branch remotes/origin/remote-branch
我从local-branch 创建了一个名为dev-branch 的分支:
$ git checkout -b dev-branch local-branch
然后我向dev-branch 提交了一些更改,现在想将其推送到remote-branch 的一个分支。在那里,它得到审查、批准,然后合并到remote-branch。之后,我需要在我的local-branch 上git pull 以将其与remote-branch 同步。
我正在尝试以下方法,但这似乎不起作用。
$ git push remotes/origin/remote-branch local-branch
我看到以下错误:
fatal: 'remotes/origin/remote-branch' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
但我在运行时可以看到存储库:
$ git branch -a
【问题讨论】:
-
看起来像:
$ git push origin local-branch有效。
标签: git github version-control git-branch git-push