我不是git master,但是我已经和它一起工作了一段时间了,并且有几个不同的项目。当然,在每个项目中,从那时git clone [repository]起,我始终可以git pull,并且只要没有特别的变化,我就可以始终如此。
最近,我不得不还原到上一个分支,并使用进行了此操作git checkout 4f82a29。当我再次准备拉动时,我发现必须将分支设置回master。现在,我不能使用直线git pull,而是必须指定git pull origin master,这很烦人,并向我表明我不完全了解发生了什么。
发生了什么变化,哪些使我无法在git pull不指定原点大师的情况下进行平直比赛?如何更改它?
更新:
-bash-3.1$ cat config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[branch "master"]
[remote "origin"]
url = git@github.com:user/project.git
fetch = refs/heads/*:refs/remotes/origin/*
更新2:明确地说,我知道我的原始方法可能不正确,但是我需要修复此存储库,以便可以git pull再次使用。目前,git pull导致:
-bash-3.1$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either. Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull ').
See git-pull(1) for details on the refspec.
If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:
branch.master.remote =
branch.master.merge =
remote..url =
remote..fetch =
See git-config(1) for details.
我可以说出git pull要合并的分支,它可以正常工作,但git pull不能像原来的分支那样工作git checkout。
慕哥6287543