Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown revision or path not in the working tree #32

Open
binsee opened this issue Sep 29, 2022 · 0 comments · May be fixed by #33
Open

unknown revision or path not in the working tree #32

binsee opened this issue Sep 29, 2022 · 0 comments · May be fixed by #33

Comments

@binsee
Copy link
Member

binsee commented Sep 29, 2022

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>...]'

const lastCommitMsg = checkReturn(shell.exec('git log --pretty=format:"%s" HEAD^0 -1', { silent : true })).stdout

refer to:

binsee added a commit to binsee/chatie-git-scripts that referenced this issue Sep 29, 2022
@binsee binsee linked a pull request Sep 29, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant