Chatie / git-scripts

Git Hooks Integration for Chatie Projects
https://npmjs.com/package/@chatie/git-scripts
Apache License 2.0
1 stars 4 forks source link

unknown revision or path not in the working tree #32

Open binsee opened 1 year ago

binsee commented 1 year ago
image

问题原因:^在window是特殊字符。 解决方法:git reset –hard HEAD”^”或git reset –hard “HEAD^”或git reset –hard HEAD~1 如果你git log只有一个提交,会出现:

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

https://github.com/Chatie/git-scripts/blob/67b252282865e1327ec068634b66f61b624106e2/bin/pre-push.ts#L62

refer to: