Skip to content

Git - fatal: ambiguous argument 'HEAD': both revision and filename #242482

@tusharsadhwani

Description

@tusharsadhwani

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.97.2
  • OS Version: MacOS

Steps to Reproduce:

  1. Create a file named HEAD at the root of your repository
  2. Try to do an action like Undo last commit

It causes the following fatal error from git:

2025-03-03 21:31:38.609 [info] > git check-ignore -v -z --stdin [17ms]
2025-03-03 21:31:41.592 [info] > git show -s --decorate=full --shortstat --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B -z HEAD [50ms]
2025-03-03 21:31:41.592 [info] fatal: ambiguous argument 'HEAD': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buggitGIT issuesinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions