Skip to content

Git: fatal: ambiguous argument 'HEAD~': unknown revision or path not in the working tree. #44776

@Tyriar

Description

@Tyriar

Windows 10/Insiders

Repro:

  1. Open a folder
  2. Init git repo
  3. Add files and do a commit
  4. Undo last commit

image

Looking for git in: C:\Program Files\Git\cmd\git.exe
Using git 2.13.2.windows.1 from C:\Program Files\Git\cmd\git.exe
> git rev-parse --show-toplevel
fatal: Not a git repository (or any of the parent directories): .git
> git rev-parse --show-toplevel
fatal: Not a git repository (or any of the parent directories): .git
> git rev-parse --show-toplevel
> git init
> git rev-parse --show-toplevel
> git config --get commit.template
Open repository: c:\Users\daimms.REDMOND\Documents\playground\t
> git status -z -u
> git symbolic-ref --short HEAD
> git rev-parse master
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
> git for-each-ref --format %(refname) %(objectname) --sort -committerdate
> git remote --verbose
> git check-ignore -z --stdin
> git check-ignore -z --stdin
> git add -A -- c:\Users\daimms.REDMOND\Documents\playground\t\script-1.bat
> git status -z -u
> git symbolic-ref --short HEAD
> git rev-parse master
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
> git for-each-ref --format %(refname) %(objectname) --sort -committerdate
> git remote --verbose
> git add -A -- c:\Users\daimms.REDMOND\Documents\playground\t\.vscode\tasks.json
> git status -z -u
> git symbolic-ref --short HEAD
> git rev-parse master
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
> git for-each-ref --format %(refname) %(objectname) --sort -committerdate
> git remote --verbose
> git commit --quiet --allow-empty-message --file -
> git status -z -u
> git symbolic-ref --short HEAD
> git rev-parse master
> git rev-parse --symbolic-full-name --abbrev-ref master@{u}
fatal: no upstream configured for branch 'master'
> git for-each-ref --format %(refname) %(objectname) --sort -committerdate
> git remote --verbose
> git config --get commit.template
> git show -s --format=%H
%B HEAD
> git reset HEAD~
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>...]'
> git show -s --format=%H
%B HEAD
> git reset HEAD~
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>...]'

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buggitGIT issuesgood first issueIssues identified as good for first-time contributorshelp wantedIssues identified as good community contribution opportunitiesverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions