| 1 |
# Set up some shortcut commands |
| 2 |
|
| 3 |
# Note that the dates are shown in the format: |
| 4 |
# |
| 5 |
# [absolute author date] (relative committer date) |
| 6 |
# |
| 7 |
# The author date is when the commit was first created by the author. The |
| 8 |
# committer date is the date of the last time this commit was changed in |
| 9 |
# anyway (e.g. in a rebase or an amend). These dates are often the same but |
| 10 |
# not if a rebase occurs. Anyway, I think showing both of these dates is |
| 11 |
# helpful. |
| 12 |
|
| 13 |
# Shorter versions of log |
| 14 |
git config --global alias.log-short "log --pretty=format:'%Cgreen%h%Creset \"%s\"%nAuthor: %an <%ae>%nDate: %ad (%cr)%n'" |
| 15 |
git config --global alias.log-short-nc "log --pretty=format:'%h \"%s\"%nAuthor: %an <%ae>%nDate: %ad (%cr)%n'" |
| 16 |
git config --global alias.log-oneline "log --pretty=format:'%Cgreen%h%Creset \"%s\" <%ae> [%ad] (%cr)'" |
| 17 |
git config --global alias.log-oneline-nc "log --pretty=format:'%h \"%s\" <%ae> [%ad] (%cr)'" |
| 18 |
git config --global alias.log-local "log --pretty=format:'%Cgreen%h%Creset \"%s\" <%ae> [%ad] (%cr)' origin.." |
| 19 |
|
| 20 |
# Show local tracking branch |
| 21 |
git config --global alias.show-tracking-branch "rev-parse --abbrev-ref --symbolic-full-name @{u}" |
| 22 |
|
| 23 |
# Summarizing changes locally and remotely |
| 24 |
git config --global alias.local-stat "!git status ; echo ; echo 'Commits in local repo not yet pushed to '\`git show-tracking-branch\`':' ; echo ; git log --pretty=format:'%Cgreen%h%Creset \"%s\" <%ae> [%ad] (%cr)' --name-status HEAD ^\`git show-tracking-branch\`" |
| 25 |
git config --global alias.local-stat-nc "!git status ; echo ; echo 'Commits in local repo not yet pushed to '\`git show-tracking-branch\`':' ; echo ; git log --pretty=format:'%h \"%s\" <%ae> [%ad] (%cr)' --name-status HEAD ^\`git show-tracking-branch\`" |
| 26 |
git config --global alias.remote-stat "!git status ; echo ; echo 'Commits in '\`git show-tracking-branch\`' not in local repo:' ; echo ; git log --pretty=format:'%Cgreen%h%Creset \"%s\" <%ae> [%ad] (%cr)' --name-status ^HEAD \`git show-tracking-branch\`" |
| 27 |
git config --global alias.remote-stat-nc "!git status ; echo ; echo 'Commits in '\`git show-tracking-branch\`' not in local repo:' ; echo ; git log --pretty=format:'%h \"%s\" <%ae> [%ad] (%cr)' --name-status ^HEAD \`git show-tracking-branch\`" |
| 28 |
git config --global alias.local-stat-short "!git status ; echo ; echo 'Commits in local repo not yet pushed to '\`git show-tracking-branch\`':' ; echo ; git log --pretty=format:'%Cgreen%h%Creset \"%s\" <%ae> [%ad] (%cr)' --shortstat --dirstat=0 HEAD ^\`git show-tracking-branch\`" |
| 29 |
git config --global alias.local-stat-short-nc "!git status ; echo ; echo 'Commits in local repo not yet pushed to '\`git show-tracking-branch\`':' ; echo ; git log --pretty=format:'%h \"%s\" <%ae> [%ad] (%cr)' --shortstat --dirstat=0 HEAD ^\`git show-tracking-branch\`" |
| 30 |
git config --global alias.remote-stat-short "!git status ; echo ; echo 'Commits in '\`git show-tracking-branch\`' not in local repo:' ; echo ; git log --pretty=format:'%Cgreen%h%Creset \"%s\" <%ae> [%ad] (%cr)' --shortstat --dirstat=0 ^HEAD \`git show-tracking-branch\`" |
| 31 |
git config --global alias.remote-stat-short-nc "!git status ; echo ; echo 'Commits '\`git show-tracking-branch\`' not in local repo:' ; echo ; git log --pretty=format:'%h \"%s\" <%ae> [%ad] (%cr)' --shortstat --dirstat=0 ^HEAD \`git show-tracking-branch\`" |
| 32 |
|
| 33 |
# Diffing text files like latex (undocumented option --color-words) |
| 34 |
git config --global alias.wlog "log --color-words" |
| 35 |
git config --global alias.wdiff "diff --color-words" |