Last active
November 23, 2022 06:33
-
-
Save inclyc/a0ce99e7f77ab5b44f2d8476d16fa148 to your computer and use it in GitHub Desktop.
pick local branches to "main" branch
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 sh | |
| set -e | |
| MAIN_BRANCH=`git branch --show-current` | |
| for pick_branch in "$@"; do | |
| git checkout -b temp | |
| git cherry-pick `git rev-parse ${pick_branch}` | |
| git branch -M ${pick_branch} | |
| git checkout ${MAIN_BRANCH} | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment