Skip to content

Instantly share code, notes, and snippets.

@houkanshan
Created May 3, 2013 08:08
Show Gist options
  • Save houkanshan/5507848 to your computer and use it in GitHub Desktop.
Save houkanshan/5507848 to your computer and use it in GitHub Desktop.
git-multi-cherry-pick
#!/bin/bash
# for git < 1.7.2
# from http://stackoverflow.com/questions/1994463/how-to-cherry-pick-a-range-of-commits-and-merge-into-another-branch/1994491#1994491
if [ -z $1 ]; then
echo "Equivalent to running git-cherry-pick on each of the commits in the range specified.";
echo "";
echo "Usage: $0 start^..end";
echo "";
exit 1;
fi
git rev-list --reverse --topo-order $1 | while read rev
do
git cherry-pick $rev || break
done
@houkanshan
Copy link
Author

缺点是git reflow起来很乱。。。。 还是升级git吧。。。。

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