Is the SHA-1 of commits calculated based only on the content of the tree?

Question 1: Because the hash is generated taking everything into account including the commit meta data (which itself contains the date and time).

Question 2: git log shows the log of the current branch. The commit 16bc8486 is not part of it. As far as I know (I’m not completely sure) the garbage collector will take it away sooner or later, if it finds it with nothing referencing it (git gc --help)..

Leave a Comment