Last active
January 15, 2019 21:30
-
-
Save lukemoderwell/3b75b0cd941a7a5ead0519ece33b1c42 to your computer and use it in GitHub Desktop.
A simple bash script that automates the process of "hotfixing" or cherry-picking commits through branches. It creates unique branches so that you can merge only what need.
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
#!/usr/bin/env bash | |
autopick() { | |
git fetch --all && | |
git checkout release && | |
git pull && | |
git submodule update && | |
git checkout -b hotfix/rel-$2 && | |
git cherry-pick $1 && | |
git push -u origin hotfix/rel-$2 && | |
git checkout master && | |
git pull && | |
git submodule update && | |
git checkout -b hotfix/mas-$2 && | |
git cherry-pick $1 && | |
git push -u origin hotfix/mas-$2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instructions:
autopick <YOUR_COMMIT_HASH_HERE> <YOUR_BRANCH_NAME_HERE>