Another potentially neat Git command to share. This time we are going to see how to list commits in a Git repository. This could be useful when writing scripts or from a personal experience in a CI/CD scenario with a bit of text processing.
Step 1. The command we are looking for is
git log, although there are few variations you could try depending on the output you are looking for. You could try each of them though.
git log --oneline
git log --name-only
Note(s): Needless to say, all of them include the git hash with a few dissimilarities. The main difference between
git log and
git reflog is that the latter shows the local history only, and it’s not being part of the repo itself (found under
The one that I’m using mostly on daily basis is
git log --name-only.