Git branch始终领先
我有一个硕士班和一个发展班。 我目前在我的发展部门 当我进行git push时,我得到了以下建议:Git branch始终领先,git,bitbucket,git-branch,Git,Bitbucket,Git Branch,我有一个硕士班和一个发展班。 我目前在我的发展部门 当我进行git push时,我得到了以下建议: fatal: The upstream branch of your current branch does not match the name of your current branch. To push to the upstream branch on the remote, use git push origin HEAD:master To push to the branch
fatal: The upstream branch of your current branch does not match the name of your current branch. To push to the upstream branch on the remote, use
git push origin HEAD:master
To push to the branch of the same name on the remote, use
git push origin development
因此,我键入git push origin development
以推送到开发分支。但我只想键入gitpush
以推进到当前分支(开发)
当我键入git status
时,我收到以下消息:
Your branch is ahead of 'origin/master' by 26 commits.
所以我做了一个从development到master的pull请求,并将development分支合并到master分支中。但我仍然得到信息“你的分支机构领先于……”
我在这里做错了什么
谢谢当您创建开发分支时,您以某种方式将其设置为跟踪
origin/master
,而不是origin/development
运行git branch-vv
查看您的分支以及它们正在跟踪的上游分支
您可以使用以下方法更正开发分支的上游设置:
git branch --set-upstream-to=origin/development development
创建开发分支时,您不知何故将其设置为跟踪
origin/master
,而不是origin/development
运行git branch-vv
查看您的分支以及它们正在跟踪的上游分支
您可以使用以下方法更正开发分支的上游设置:
git branch --set-upstream-to=origin/development development
谢谢您的快速回复。如果曲目设置为“原点/主控”,这意味着什么@Duncan@DennisPerremans:有关分支机构上游设置的信息,请参阅或我较长的回答,以感谢您的快速回复。如果轨迹设置为原点/主轨迹,这实际上意味着什么@Duncan@DennisPerremans:有关分支的上游设置的信息,请参阅或我的较长回答