How do we get a list with full hashes ?
git reflog
I could not find about it in the docs.
5826591 HEAD@{0}: commit : Forgot password
c8a98d1 HEAD@{1}: commit : cleaned
02338ed HEAD@{2}: commit : forward to login page
528bec8 HEAD@{3}: commit : password changed
If you have the hash for a commit, you can use the git show command to display the changes for that single commit. The output is identical to each individual commit when using git log -p .
Hashes are what enable Git to share data efficiently between repositories. If two files are the same, their hashes are guaranteed to be the same. Similarly, if two commits contain the same files and have the same ancestors, their hashes will be the same as well.
"SHA" stands for Simple Hashing Algorithm. The checksum is the result of combining all the changes in the commit and feeding them to an algorithm that generates these 40-character strings. A checksum uniquely identifies a commit.
Git uses hashes in two important ways. When you commit a file into your repository, Git calculates and remembers the hash of the contents of the file. When you later retrieve the file, Git can verify that the hash of the data being retrieved exactly matches the hash that was computed when it was stored.
Just execute:
> git reflog --no-abbrev
nb. I should mention this answer just list commit
's not all entries (like rebase
, pull
etc)
git reflog can accept format
options the same as git log.
So you could use this…
git reflog show --format='%C(auto)%H %<|(17)%gd: commit : %s'
Which you get you output like this:
f2801fa5ea4a28b573ce14d6ca8502a9dd8dc7a1 HEAD@{39}: commit : Initial commit
7de68d559ccf7a3435af9ddaa432c81cb59a20fc HEAD@{40}: commit : Add Update packages playbook for simplicity
f63b2757f2b19188d89fe7bb0f76c56ebee3634f HEAD@{41}: commit : Preliminary structure
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With