In Git, what is the difference between long and short hashes?

前端 未结 4 1014
南旧
南旧 2020-12-09 14:58

Here is the long Git hash:

commit c26cf8af130955c5c67cfea96f9532680b963628

Merge: 8654907 37c2a4f

Author: nicolas

Date: Wed Apr 26 13:28:2

4条回答
  •  盖世英雄少女心
    2020-12-09 15:36

    The short hash shows the first seven characters of the hash. The short hash of c26cf8af130955c5c67cfea96f9532680b963628 is c26cf8a in the second row. See the documentation:

    Git is smart enough to figure out what commit you meant to type if you provide the first few characters, as long as your partial SHA-1 is at least four characters long and unambiguous.

提交回复
热议问题