Created
September 6, 2016 14:24
-
-
Save m0tive/dffa291f5d917bec66b7c2635c2cb261 to your computer and use it in GitHub Desktop.
git fresh-checkout
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] | |
tracked = "!f(){ git rev-parse --symbolic-full-name --abbrev-ref $1@{u}; }; f" | |
fresh-checkout = "!f(){ B=$1; T=$(git tracked $B) R=$(git rev-parse $B); git branch -D $B && git checkout -b $B $T && git cherry-pick $T..$R; }; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment