Git is the fatal ambiguous argument "HEAD" for both editing and using the file name - to separate paths from revisions like Git [....] - [...]

  • My git version is 1.8.0 mysysgit0.

  • Remote repo on -linux server.

  • Local repo - Windows 7.

When I try to make local changes, it talks about a fatal error below:

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

Can anyone guess what the problem is? What is a fix?

+6
source share
1 answer

You must have a file in your repository named HEAD , and this confuses git , because HEAD also the usual name for the active active branch.

You can use a double dash to disambiguate, for example:

 git log -- HEAD 

This will show a history of a file called HEAD .

It may be prudent to avoid having files with these special names in order to avoid these problems.

+6
source

All Articles