Skip to content

Instantly share code, notes, and snippets.

@jussi-kalliokoski
Last active July 11, 2022 10:08
Show Gist options
  • Save jussi-kalliokoski/4381703 to your computer and use it in GitHub Desktop.
Save jussi-kalliokoski/4381703 to your computer and use it in GitHub Desktop.
Cherry-picks commits from master that have changes to specified files.
$!/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
@aigitia
Copy link

aigitia commented Apr 3, 2019

should not first line have #!/usr/bin/env instead of $!/usr/bin/env, i.e. hash instead of the dollar?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment