Last active
June 10, 2020 20:36
-
-
Save karussell/b78afa2d8d33a93686ed78670cbde1df to your computer and use it in GitHub Desktop.
append to foreign pull request
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
| # Here is how to append commits to a pull request from a foreign repository without (slow) cloning | |
| # When you put the function in .bashrc you can use it via: | |
| # cd graphhopper # go into your local copy of the repo where the pull request was made | |
| # pranch graphhopper msbarry:sample-and-3d-simplify | |
| # The first argument is your organisation and the second argument is "foreign_organisation:foreign_branch" e.g. copied from the pull request | |
| pranch() | |
| { | |
| forbranch=${2#*:} # == foreign branch | |
| fororg=${2%%:*} # == foreign organisation | |
| locbranch=${fororg}_${forbranch} | |
| locorg=$1 | |
| git checkout -b $locbranch master | |
| git pull [email protected]:$fororg/$locorg.git $forbranch | |
| echo "" | |
| echo "# now do some commits and after you pushed they will appear at the pull request:" | |
| echo "git push [email protected]:$fororg/$locorg.git $locbranch:$forbranch" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment