我不是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
。