5 ms·
Here are two variations that I find useful day-to-day. 1. Graph showing commits on all branches, decorated with branch and tag names, short commit hashes, comm
by philbo 13y ago
Here are two variations that I find useful day-to-day.
1. Graph showing commits on all branches, decorated with branch and tag names, short commit hashes, committer name and commit comment:
git log --graph --all --abbrev-commit --pretty=format:'%C(red)%d%x20%C(yellow)%h%x20%C(green)%an%x20%Creset%s'
2. List commits in HEAD that aren't in master:
git log --abbrev-commit --pretty=format:'%C(yellow)%h%x20%C(green)%an%x20%Creset%s' master..HEAD
- glenjamin 13y agoyou can get a slightly more reliable list of commits that are in HEAD that aren't in master using --not: git log HEAD --not master or the shorthand git log HEAD ^master
- leephillips 13y agoWhat terminal does this work in? I just got raw escape codes.
- philbo 13y agoOh, I had no idea it wasn't portable, sorry. I'm using iTerm2 on OSX, but maybe worth trying them without the colouring: git log --graph --all --abbrev-commit --pretty=format:'%d%x20%h%x20%an%x20%s' git log --abbrev-commit --pretty=format:'%h%x20%an%x20%s' master..HEAD
- leephillips 13y agoThose work, thanks. I'm on Linux using xfce4-terminal at the moment. There's probably a way to get the color codes to work, but I don't know it.
- nuxi 13y agoWhich PAGER are you using? If it's less, try setting PAGER='less -R', or LESS=-R to enable raw control character output.
- leephillips 13y agoBingo! Nothing to do with the terminal at all! Thanks!