我在沙箱存储库中有一个名为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发布于 2015-11-20 23:23:38
要将local-branch从您的存储库推送到远程origin上的remote-branch,请使用
git push origin local-branch:remote-branch根据你在问题中创建local-branch的方式,git应该已经将其配置为跟踪origin/remote-branch。在这种情况下,在签出local-branch的同时使用一个简单的git pull就足以进行同步。
你的工作流程很复杂。我建议寻找简化方法,使每个给定分支的名称更少。
https://stackoverflow.com/questions/33826576
复制相似问题