Git log – The good parts
zwischenzugs.com
Git log – The good parts
1–10 of 86 posts
Re: Git log – The good parts
#2 git clone https://github.com/ianmiell/cookbook-openshift3-frozen
cd cookbook-openshift3-frozen
git log
git log --oneline
git log --oneline --decorate
git log --oneline --decorate --all
git log --oneline --decorate --all --graph
git log --oneline --decorate --all --graph --simplify-by-decoration
git log --oneline --decorate --all --graph --stat
git log -G 'chef-client' --graph --oneline --stat
git log -G 'chef-client' --graph --oneline --stat --pickaxe-allRe: Git log – The good parts
#3Re: Git log – The good parts
#4Commands in the article: git clone https://github.com/ianmiell/cookbook-openshift3-frozen cd cookbook-openshift3-frozen git log git log --oneline git log --oneline --decorate git log --oneline --decorate --all git log --oneline --decorate --all --graph git log --oneline --decorate --all --graph --simplify-by-decoration git log --oneline --decorate --all --graph --stat git log -G 'chef-client' --graph --oneline --stat…
When using git log, do it like "a dog"
git log --all --decorate --oneline --graph
I must say I had forgotten about the `--all` part, but the article mentions that it should be on by default if running interactively in the terminal, at least with recent versions of git.[1]It might have been https://stackoverflow.com/questions/1057564/pretty-git-branc... but I am not 100% sure.
Re: Git log – The good parts
#5 FORMAT="%C(auto)%h %C(magenta)%ad %C(cyan)%an%C(auto)%d %s"
PRETTY="--pretty=format:'$FORMAT' --date=short"
git config --global alias.lga "log --graph --all $PRETTY"
git config --global alias.lg "log --graph $PRETTY"
git config --global alias.la "log --all $PRETTY"
git config --global alias.ll "log $PRETTY"
git config --global alias.lf "log --pretty=fuller --stat"
There are two interesting things to note here:• Since the --decorate option is now enabled by default (at least since Git 2.13), I don't have the --decorate option in my aliases. You may have to add them if you are using an older version of Git.
• Often while looking at the commit log, I need to know the commit date and the committer name which --oneline option does not show by default, so instead of using the --oneline option, I am formatting the one-liner logs myself with the `--pretty=format:` option to see these details.
The --simplify-by-decoration option is a nice one, something I can add to my list of aliases.
I have these aliases and a few other useful aliases documented in a bonus section named "Nifty Commands" in a fork and pull request workflow document I shared on Hacker News about a month ago. Here is the URL: https://github.com/susam/gitpr.
Re: Git log – The good parts
#6 git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset' --abbrev-commit"
I strongly recommend both.--
[0] - https://magit.vc/
Re: Git log – The good parts
#7One use case is : "when did branchA fork from master ?"
git log --graph --oneline --... --first-parent branchA master
Re: Git log – The good parts
#8Re: Git log – The good parts
#9Or use sourcetree
Re: Git log – The good parts
#10Another useful option is '--first-parent' One use case is : "when did branchA fork from master ?" git log --graph --oneline --... --first-parent branchA master