Created
August 21, 2012 18:21
-
-
Save alexwybraniec/3418114 to your computer and use it in GitHub Desktop.
gmp (git merge pull/push)
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
(Assuming you are using bash) | |
nano ~/.bashrc | |
Add this line to the bottom of your file... | |
gmp() { git checkout $2 && git pull origin $2 && git merge $1 && git push origin $2 && git checkout $1; } | |
Usage: | |
gmp current_branch target_branch | |
For example: | |
gmp dev staging | |
checks out staging, pulls it to make sure it is up to date, merges in dev, pushes staging back to origin and then returns you to dev. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment