Last active
October 5, 2019 17:02
-
-
Save cbillowes/948406c1826ab6d5f935350474288934 to your computer and use it in GitHub Desktop.
Advanced Git commands
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
# list all commits for a given file which includes cases where the file has been renamed. | |
git log --follow -- filename | |
# log with a decorated graph | |
git log --graph --abbrev-commit --decorate --date=relative --all | |
# short status on branch | |
git status --short --branch | |
# see log with diffs | |
git log --stat | |
git log --stat -p | |
# compact log | |
git log --oneline --decorate --graph --all | |
# log with graph and decorated information | |
# https://stackoverflow.com/questions/1057564/pretty-git-branch-graphs | |
git log --pretty='%Cblue%h%Creset | %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %C(cyan)[%an]%Creset' --graph | |
# Visualize per-character differences in a unified diff file | |
# https://stackoverflow.com/questions/3231759/how-can-i-visualize-per-character-differences-in-a-unified-diff-file | |
git diff --word-diff --unified=10 | |
git diff --color-words | |
git diff --color-words='[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install script. You'll need to update your alias to the revision you want to reference.