Skip to content

Instantly share code, notes, and snippets.

@m0tive
Created September 6, 2016 14:24
Show Gist options
  • Save m0tive/dffa291f5d917bec66b7c2635c2cb261 to your computer and use it in GitHub Desktop.
Save m0tive/dffa291f5d917bec66b7c2635c2cb261 to your computer and use it in GitHub Desktop.
git fresh-checkout
[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