开发者

Git - "shorthand" for hashes not working?

开发者 https://www.devze.com 2023-02-03 12:09 出处:网络
Anyone know why this could be? $ git log --pretty=onelin开发者_运维百科e --abrev-commit adaa8c4 added a third line

Anyone know why this could be?

$ git log --pretty=onelin开发者_运维百科e --abrev-commit
adaa8c4 added a third line
6f80266 added a second line
9c631a4 initial commit
$ git checkout 9c
$ error: pathspec '9c' did not match any file(s) known to git.
$ git checkout 9c631a4
...works...

I was under the impression that I was supposed to be able to only type the first few characters of a hash, otherwise it gets pretty annoying...

git version is 1.7.3.4, thru MacPorts, running on OSX 10.6.6. No modifications to .gitconfig that could even be remotely related.

Thanks! :)


I believe that you are required to type at least four characters of the hash. At the very least, most of the tools that output short hashes won't let you output any fewer than four characters.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号