Skip to content

Discard changes: fatal error: ambiguous argument #2037

@WelliSolutions

Description

@WelliSolutions

Repro steps (Windows):

  1. git init discard-changes
  2. cd discard-changes
  3. echo "">test.txt
  4. Open the repo in SourceGit
  5. For the local changes, click on the "discard all changes button" ⮪
  6. Confirm the dialog with OK

Result:

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Expected:

The untracked file test.txt is cleaned up.

Additional information:
Git Extensions shows the preview as

C:\Program Files\Git\bin\git.exe" clean -d --dry-run
Would remove test.txt
Done

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions