我的同事承诺掌握一些变化,我不得不相应地更新我的分支。经过一番挣扎,我以为我做对了。但是,当我运行git remote show origin
时,我得到:
* remote origin
Fetch URL: https://bitbucket.org/....git
Push URL: https://bitbucket.org/....git
HEAD branch: master
Remote branches:
layout tracked
layout-report tracked
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local refs configured for 'git push':
layout pushes to layout (fast-forwardable)
layout-report pushes to layout-report (local out of date)
master pushes to master (up to date)
我正在尝试处理的分支是layout-report
,其中说“本地已过时”。所以我尝试了git pull
,我得到了:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> layout-report
在BitBucket上我可以看到我的分支。这里发生了什么?
答案 0 :(得分:2)
您可能已使用git push origin branch
没有跟踪信息只是意味着默认情况下没有指定它应该从哪里推送/拉出。
git
甚至会告诉您如何设置此(默认)跟踪信息:
git branch --set-upstream-to=origin/<branch> layout-report
请参阅git book中的Working with Remotes。