The idea here would be to show some git log tricks and to develop the article, whenever I find something more and more worthy. Before starting this one, please remember that exiting vim editors in the command prompt is with :q.
- Git Log with only 5 last commits
1 |
git log -n 5 |
- Git Log with all commits since 2022
1 |
git log --after="2022-1-1" |
- Have everything important on 1 line, like a story
1 |
git log --oneline |
- Git Log with all commits affecting a specific file from the repository
1 |
git log -- README.md |
- History of all commits of a git file
1 |
git log -p Formatting >here.txt |
- Grouping by author
1 |
git shortlog |
- Searching through commits, for a specific word
1 |
git log -S comments |
returning this:
That’s all folks! 🙂