吉特远程HEAD模棱两可 [英] Git. Remote HEAD is ambiguous

查看:90
本文介绍了吉特远程HEAD模棱两可的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我检查了相关的线程,但仍然无法弄清幕后发生的事情.

I checked the relevant threads but still can't figure out what is going on behind the scenes.

当我键入git remote show origin时,我得到了:

When I typed git remote show origin, I got:

* 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,我得到了:

I also checked git show-ref, and I got:

3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/heads/development
3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/heads/master
3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/remotes/origin/development
3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/remotes/origin/master

这是我通过执行git branch -a拥有的所有分支的列表:

Here is the list of all branches I have by executing git branch -a:

  development
* master
  remotes/origin/development
  remotes/origin/master

这是.git/config中的内容:

And this is what is in the .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

似乎远程开发和master分支共享同一节点.我该如何解决这个模棱两可的问题?

It seems that the remote development and master branch share the same node. How do I solve this ambiguity problem?

推荐答案

您的远程存储库没有任何问题. git告诉您远程HEAD模棱两可",因为master和development都具有相同的SHA1哈希.如果您只是将开发工作从master分支出来,那应该是这样.

There is nothing wrong with your remote repos. git tells you "remote HEAD is ambiguous" because master and development both have same SHA1 hash. If you've just branched development out from master, that's how it should be.

尝试做出一些掌握或发展的事情,并将其推陈出新;该模棱两可"的消息将消失,并且您刚刚承诺的任何分支都将成为远程HEAD分支.

Try to commit something to master or development and push it to origin; that "ambiguous" message will be gone, and whichever branch you just committed to will become the remote HEAD branch.

这篇关于吉特远程HEAD模棱两可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆