没有当前分支的跟踪信息 [英] There is no tracking information for the current branch
问题描述
我在相当短的时间内使用过github,而且我一直使用客户端来执行提交和提交。我决定在昨天从git bash尝试它,并且我成功创建了一个新的repo和提交的文件。
今天,我从另一台计算机上更改了存储库,已经提交了更改,现在我回到了主页并执行了 git pull
来更新我的本地版本,并得到了这个结果:
当前分支没有跟踪信息。
请指定您想要合并的分支。
详情请参阅git-pull(1)
git pull< remote> <分支>
如果你想为这个分支设置跟踪信息,你可以这样做:
git branch --set-upstream develop origin /< branch>
这个回购的唯一贡献是我和没有分支(只是一个主)。我在windows上,我已经从git bash执行了pull:
git status:
$ git status
#分支主
无提交,工作目录干净
git分支:
$ git branch
* master
我做错了什么?
你可以指定你想要拉的分支:
git pull origin master
或者你可以设置它,以便您的本地主分支作为上游跟踪github主分支:
git branch --set-upstream- to = origin / master master
git pull
这个分支跟踪是为您自动设置的当你 克隆存储库(仅限默认分支),但是如果将远程存储库添加到现有存储库,则必须自行设置跟踪。谢天谢地,git给出的建议使得记住该怎么做非常容易。
I've been using github from a relatively short period, and I've always used the client to perform commits and pulls. I decided to try it from the git bash yesterday, and I successfully created a new repo and committed files.
Today I did changes to the repository from another computer, I've committed the changes and now I'm back home and performed a git pull
to update my local version and I get this:
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 develop origin/<branch>
the only contributor to this repo is me and there are no branches (just a master). I'm on windows and I've performed the pull from git bash:
git status:
$ git status
# On branch master
nothing to commit, working directory clean
git branch:
$ git branch
* master
What am I doing wrong?
You could specify what branch you want to pull:
git pull origin master
Or you could set it up so that your local master branch tracks github master branch as an upstream:
git branch --set-upstream-to=origin/master master
git pull
This branch tracking is set up for you automatically when you clone a repository (for the default branch only), but if you add a remote to an existing repository you have to set up the tracking yourself. Thankfully, the advice given by git makes that pretty easy to remember how to do.
这篇关于没有当前分支的跟踪信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!