How to disambiguate an ambiguous abbreviated sha1 in git

后端 未结 2 1655
迷失自我
迷失自我 2020-12-09 14:59

I was intrigued by Josh Stone\'s analysis of sha1 abbreviation collisions.

Let\'s say somebody wrote down an abbreviated commit id, 8b82547e33, at a tim

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 15:29

    You can use git rev-parse, assuming you have at least a 4-digit prefix of the full hash.

    git rev-parse --disambiguate=8b82547e33
    

提交回复
热议问题