我检查了相关主题,但仍然无法弄清楚幕后发生了什么。
当我输入git remote show origin
时,我得到了:
* remote origin
Fetch URL: xxxx
Push URL: xxxx
HEAD branch (remote HEAD is ambiguous, may be one of the following):
development
master
Remote branches:
development tracked
master tracked
Local branches configured for 'git pull':
development merges with remote development
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
我还检查了git show-ref
,我得到了:
3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/heads/development
3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/heads/master
3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/remotes/origin/development
3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/remotes/origin/master
以下是执行git branch -a
所有分支的列表:
development
* master
remotes/origin/development
remotes/origin/master
这就是.git / config中的内容:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
ignorecase = true
hideDotFiles = dotGitOnly
autocrlf = false
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = xxxx
push = refs/heads/master:refs/heads/master
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "development"]
remote = origin
merge = refs/heads/development
远程开发和主分支似乎共享同一个节点。如何解决这种歧义问题?
答案 0 :(得分:41)
您的远程回购没有任何问题。 git告诉你“远程HEAD是模糊的”,因为master和development都有相同的SHA1哈希。如果你只是从主人那里分支开发,那应该是这样的。
尝试提交一些东西来掌握或开发并将其推向原点; “模棱两可”的消息将消失,无论你刚才提交的哪个分支都将成为远程HEAD分支。