Created
September 25, 2018 23:06
-
-
Save eschultink/4c2bae6f34097d38b837efeda1210110 to your computer and use it in GitHub Desktop.
Alias section of my .gitconfig
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
[alias] | |
# find when commits were merged | |
# USAGE: | |
# git find-merge <SHA-1> // when merged to current branch | |
# git find-merge <SHA-1> master // when merged to master | |
find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'" | |
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'" | |
# pull and fast-forward ALL local branches | |
pull-all = !"for b in $(git for-each-ref refs/heads --format='%(refname)') ; do git checkout ${b#refs/heads/} ; git pull --ff-only ; done" | |
# list 10 most recent tags | |
tags-recent = !"git tag --list --sort=-refname |head -n 10" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment