Skip to content

Instantly share code, notes, and snippets.

@raym
Created February 6, 2015 01:44
Show Gist options
  • Save raym/5dabb8e89f4d0bd55473 to your computer and use it in GitHub Desktop.
Save raym/5dabb8e89f4d0bd55473 to your computer and use it in GitHub Desktop.
commands run to move the last 4 commits to a different branch via cherry pick
git log -4 | grep 'commit' | awk '{print $2}' | tail -r > commits.txt
git co destination_branch
for commit in $(cat commits.txt); do git cherry-pick $commit; done
git log -4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment