Reputation: 11020
When I pipe a git command to head to display only a few dozens of commits, the colors are lost:
git log --oneline | head -50
How to keep colors with a limited number of lines?
Upvotes: 1
Views: 477
Reputation: 156
-(n) Show only the last n commits
Ref : https://git-scm.com/book/no-nb/v1/Grunnleggende-Git-Viewing-the-Commit-History
For exemple
git log -50 --oneline
Upvotes: 5
Reputation: 3031
How about using -50 as a parameter in your git log command?
It will show the newest 50 commits.
You can also write
Upvotes: 3
Reputation: 12382
Git detects that you're piping to something, so it disables color, but you can force it to use color with --color
:
git log --graph --oneline --all --decorate --color | head -50
Upvotes: 4