What is the basis for calculating the SHA1 value of git's commit id?
漂亮男人
漂亮男人 2017-05-02 09:33:46
0
1
681

What is the SHA1 value of git's commit id based on?

漂亮男人
漂亮男人

reply all(1)
迷茫

In Git, every commit id的信息(如f2c8ea6ea648d4b097f2e552b674f856a86c31cc)就是一个sha1 hash值,如果想查看自己分支中的coomit id执行git log will do. As picture

Generate this hash value, which is a checksum checksum of the content and header information in the Git repository that the commit is. Linus, the founder of the Linux kernel and the developer of Git, said that Git uses sha1 not for security, but for data integrity; it can ensure that many years later, when you checkout a commit again, it will be It is exactly the same as it was at the time many years ago and is completely trustworthy. In Git, the directory is simply divided based on the 40 hexadecimal digits of the commit's sha1 value. The first 2 digits are used as the directory name, and below it is a file name composed of the remaining 38 digits. Hope it helps you. For details, please refer to Git Object

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template