Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git branch始终领先_Git_Bitbucket_Git Branch - Fatal编程技术网

Git branch始终领先

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

我有一个硕士班和一个发展班。 我目前在我的发展部门

当我进行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 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:有关分支的上游设置的信息,请参阅或我的较长回答