List all the commits with Indexes: (Format: <index> <commit-id> <commit-message>)
git log --oneline | nl -v0 | sed 's/^ \+/&HEAD~/'
Code language: JavaScript (javascript)
List all the commits without numbers: (Format: <commit-id> <commit-message>)
git log --oneline | sed 's/^ \+/&HEAD~/'
Code language: JavaScript (javascript)
Reference:
https://git-scm.com/docs/git-log
Leave a Reply