Created
June 6, 2016 09:58
-
-
Save kopiro/7beb5d7b15e1161334882a03a9dac491 to your computer and use it in GitHub Desktop.
Git Pick
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
#!/bin/bash | |
# This script pick the latest commit of current branch, apply | |
# it to another branch (the argument) and push against its remote | |
# Example: gpick "PR-1234" | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
commit=$(git rev-parse HEAD) | |
git checkout "$1" && | |
git cherry-pick "$commit" && | |
git push && | |
git checkout "$branch" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment