Created
November 26, 2018 18:00
-
-
Save shapr/632015d6dd353fe3d0a7ccc4b3668ba0 to your computer and use it in GitHub Desktop.
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] | |
# Checkout a pull request branch on an upstream project. It | |
# handles PRs that get rebased as well. | |
# | |
# git pr 3 | |
pr = "!f() { git checkout master; git branch -D pr/$1 || true; git fetch origin refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f" | |
dpr = "!f() { git checkout develop; git branch -D pr/$1 || true; git fetch upstream refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f" | |
pur = "!f() { git checkout master; git branch -D pr/$1 || true; git fetch upstream refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f" | |
# Pull a rebasing branch on a fork. Useful for viewing someones | |
# rebasing feature branch from a clone of their fork. | |
pbr = "!f() { b=$(git rev-parse --abbrev-ref HEAD); git fetch origin $b && git reset --hard origin/$b; }; f" | |
# Really really clean checkout. Just shy of a completely fresh | |
# clone. | |
squeaky-clean = "!f() { git reset --hard && git clean -dxff; git submodule foreach git squeaky-clean; }; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment