-
-
Save yannmh/4ac0d7b94c0f2bc752cb to your computer and use it in GitHub Desktop.
This file contains hidden or 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] | |
checkoutpr = "!f() { git fetch origin refs/pull/$1/head:pr/$1; git checkout pr/$1; } ; f" | |
checkoutcontrib = "!f() { git checkout master && git pull && git remote add $1 [email protected]:$1/dd-agent && git fetch $1 $2 && git checkout -b $3 $1/$2 && git rebase master } ; f" |
This file contains hidden or 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
# First of course clear your staging area and stash your mess | |
# Forked and PR'd from contributor:mysuperfeature | |
git checkoutcontrib contributor mysuperfeature leo/rebasedsuperfeaturebranch | |
# OK it's rebased I can do my mods | |
git rebase -i master | |
# Include a message in the commit if you're commiting someone else's work | |
# For example: | |
# [[email protected]] rebased current work to get new feature and minor | |
# cosmetic changes | |
# Or add more work | |
git commit -m "Some work" | |
git push origin leo/rebasedsuperfeaturebranch | |
# Create a new PR with this branch | |
# Close the other one | |
# Don't forget to thank the contributor! | |
# If you want just to checkout one PR's code to play with it locally | |
# Get the PR number, return in a clean state and run for PR 23432 | |
git checkoutpr 23432 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment