2014-02-24 79 views
1

這是一個測試回購,所以我可以刪除它或提交併完成它。但是,我很惱火,我不能復位或藏匿的變化和修復回購(曖昧refmane):骯髒的回購模糊refmane

[email protected]:~/gits/test$ git status 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
# Not currently on any branch. 
# Changes not staged for commit: 
#  modified: test 
#  modified: test2 
# 
no changes added to commit 

好了,所以儘量使回購清潔:

[email protected]:~/gits/test$ git reset --hard 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
HEAD is now at 374f306 test2 id 

都能跟得上。好吧,試着存儲更改:

[email protected]:~/gits/test$ git stash 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
Saved working directory and index state WIP on (no branch): 374f306 test2 id 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
warning: refname 'HEAD' is ambiguous. 
HEAD is now at 374f306 test2 id 

沒有。因此,儘量刪除分支:

[email protected]:~/gits/test$ git branch -d HEAD 
error: Cannot delete the branch 'HEAD' which you are currently on. 

And Nope。從哪裏來?

[編輯1]

[email protected]:~/gits/test$ git branch foo 
warning: refname 'HEAD' is ambiguous. 
fatal: Ambiguous object name: 'HEAD'. 

[編輯2]

[email protected]:~/gits/kore_tools.git/test$ git branch -a 
* (no branch) 
    master 
    mergetest 
    remotes/origin/HEAD -> origin/master 
    remotes/origin/master 
+0

另外: swilson @ swlap1:〜/控釋片/測試$ LS ../.git/modules/test/refs/heads 什麼都不顯示。 – ag4ve

回答

1

HEAD不是分支 - 它是指向在歷史的當前位置。

warning: refname 'HEAD' is ambiguous. 

表示您的當前位置(HEAD)未綁定到任何分支。您可以使用

git branch <branch-name> 

從您的當前位置創建一個新的早午餐和此消息將消失

+0

swilson @ swlap1:〜/ gits/test $ git branch foo 警告:refname'HEAD'含糊不清。 fatal:模糊的對象名稱:'HEAD'。 – ag4ve

+0

meh,不知道如何在那裏放置換行符,但無論如何,這是行不通的 – ag4ve

+0

你能提供'git branch -a' –