fatal: ambiguous argument '': unknown revision or path not in the working tree.
See original GitHub issuefresh install, tried running pre-commit clean
, no change:
$ pip install pre-commit
Collecting pre-commit
Using cached pre_commit-0.8.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): aspy.yaml in /Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages (from pre-commit)
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages (from pre-commit)
Requirement already satisfied (use --upgrade to upgrade): jsonschema in /Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages (from pre-commit)
Requirement already satisfied (use --upgrade to upgrade): pyterminalsize in /Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages (from pre-commit)
Requirement already satisfied (use --upgrade to upgrade): cached-property in /Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages (from pre-commit)
Requirement already satisfied (use --upgrade to upgrade): pyyaml in /Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages (from pre-commit)
Requirement already satisfied (use --upgrade to upgrade): nodeenv>=0.11.1 in /Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages (from pre-commit)
Requirement already satisfied (use --upgrade to upgrade): functools32 in /Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages (from jsonschema->pre-commit)
Installing collected packages: pre-commit
Successfully installed pre-commit-0.8.0
$ pre-commit autoupdate 500ms
Updating git://github.com/pre-commit/pre-commit-hooks...An unexpected error has occurred: CalledProcessError: Command: ('/usr/local/bin/git', 'reset', '', '--hard')
Return code: 128
Expected return code: 0
Output: (none)
Errors:
fatal: ambiguous argument '': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Check the log at ~/.pre-commit/pre-commit.log
Traceback (most recent call last):
File "/Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages/pre_commit/error_handler.py", line 47, in error_handler
yield
File "/Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages/pre_commit/main.py", line 155, in main
return autoupdate(runner)
File "/Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages/pre_commit/commands/autoupdate.py", line 77, in autoupdate
new_repo_config = _update_repository(repo_config, runner)
File "/Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages/pre_commit/commands/autoupdate.py", line 34, in _update_repository
with cwd(repo.repo_path_getter.repo_path):
File "/Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages/cached_property.py", line 26, in __get__
value = obj.__dict__[self.func.__name__] = self.func(obj)
File "/Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages/pre_commit/store.py", line 47, in repo_path
return self._store.clone(self._repo, self._sha)
File "/Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages/pre_commit/store.py", line 122, in clone
cmd_output('git', 'reset', sha, '--hard', env=no_git_env())
File "/Users/gretel/.pyenv/versions/2.7.11/envs/taxigirl-2.7.11/lib/python2.7/site-packages/pre_commit/util.py", line 197, in cmd_output
returncode, cmd, retcode, output=(stdout, stderr),
CalledProcessError: Command: ('/usr/local/bin/git', 'reset', '', '--hard')
Return code: 128
Expected return code: 0
Output: (none)
Errors:
fatal: ambiguous argument '': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
fatal: ambiguous argument 'origin': unknown revision or path ...
I tried. Yes it works. It seems git diff origin is short for git diff master origin/master if the current branch is master...
Read more >unknown revision or path not in the working tree" mean? : r/git
I was wondering if someone could explain the meaning of fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the working tree ......
Read more >fatal: ambiguous argument 'master': unknown revision or path ...
Hi Checkout team, I'm trying to checkout both the PR branch & master so diffs can be run on the two and only...
Read more >fatal: ambiguous argument 'master': unknown revision or path ...
The error looks like you're using a non-existent reference (branch/tag). Try specifying the correct branch and tag using the branch/tag ...
Read more >My Git Repository is throwing an ambiguous error
... argument 'v0.4.1': unknown re vision or path not in the working tree. npm ERR! git rev-list -n1 v0.4.1: Use '--' to separate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ah, had to be explicit on
sha
:works fine now. maybe i was confused by the documentation.
let me try:
The value of
sha
should not bemaster
orHEAD
- both will only match the latest version at install time, and prevent subsequent updates. On GitHub, the id of the most recent commit can be looked up easily (i.e. commit/master). Alternatively, settingsha
tomaster
and runningpre-commit autoupdate
before anything else will automatically populate the values of thesha
keys in the configuration file:which on running
pre-commit autoupdate
gets toand is now ready to commit: