Last active
July 11, 2022 10:08
-
-
Save jussi-kalliokoski/4381703 to your computer and use it in GitHub Desktop.
Cherry-picks commits from master that have changes to specified files.
This file contains 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 | |
branch=`git symbolic-ref --short HEAD` | |
git checkout master | |
commits=`git log --pretty="%H" --reverse -- $*` | |
git checkout $branch | |
for commit in $commits; do | |
git cherry-pick $commit | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
should not first line have #!/usr/bin/env instead of $!/usr/bin/env, i.e. hash instead of the dollar?