我不是一个git大师,但我已经用它工作了一段时间,有几个不同的项目。在每个项目中,我总是git克隆[存储库],从这一点上,我总是可以git拉,当然,只要我没有突出的变化。
最近,我不得不恢复到以前的分支,并且使用git签出4f82a29。当我再次准备拉的时候,我发现我必须把树枝放回主人的位置。现在,我不能使用一个直接的git拉,而是,必须指定git拉源主,这是讨厌的,并向我表明,我不完全理解正在发生什么。
有什么改变,不允许我做一个直接的git拉没有指定的起源主人,我如何改变它回来?
更新:
-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拉。目前,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拉哪个分支合并,它工作正确,但git拉不工作,因为它原来在我的git签出之前。