Created
September 30, 2016 17:50
-
-
Save scriptonian/14af2cd0491f7881025f44f2a08c3d3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. | |
git log | |
this allows you to see a history of commits | |
2. | |
git log --pretty=oneline | |
limit output to one line per commit. as oppose to the first one that shows quite a bit of info. like author and date, etc | |
3. | |
git log --pretty='%h | %d %s ($cr) [%an]' | |
h: abreviated hash, d:any reference pointing to commit, $s:first line of commit message, %cr: timestamp when commit was made, %an: commit author | |
see options at http://git-scm.com/docs/pretty-formats | |
4. | |
git log --pretty='%Cred%h%Creset | %C(yellow)%d Creset %s %Cgreen($cr)%Creset %C(cyan)[%an]%Creset' | |
same as before but we are adding color to it. | |
5. | |
git log --pretty='%Cred%h%Creset | %C(yellow)%d Creset %s %Cgreen($cr)%Creset %C(cyan)[%an]%Creset' --graph --all | |
add a graph representation to log | |
6. | |
git config --global alias.lg "log --pretty='%Cred%h%Creset | %C(yellow)%d Creset %s %Cgreen($cr)%Creset %C(cyan)[%an]%Creset' --graph --all" | |
creates an alias for #5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment