Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git fatal ambiguous argument 'HEAD' both revision and file name use -- to separate paths from revision like git [....]--[...] [closed]

Tags:

git

  • My git version is 1.8.0 mysysgit0.

  • Remote repo on -linux server.

  • Local repo - Windows 7.

When I try to commit my local changes it says fatal error below:

fatal ambiguous argument 'HEAD' both revision and file name use -- to separate paths from revision like  git [....]--[...]

Could any one suggest what is the problem? What is the fix?

like image 234
Srini Avatar asked Feb 27 '13 07:02

Srini


1 Answers

You must have file in your repository called HEAD, and this is confusing git because HEAD is also customary name for currently active branch.

You can use double-dash to remove ambiguity, like this:

git log -- HEAD

This will show history about file named HEAD.

It is probably wise to avoid having files with these special names to avoid these issues.

like image 71
mvp Avatar answered Oct 15 '22 07:10

mvp