Skip to content

Instantly share code, notes, and snippets.

@johnkpaul
Created August 23, 2012 01:45
Show Gist options
  • Save johnkpaul/3431188 to your computer and use it in GitHub Desktop.
Save johnkpaul/3431188 to your computer and use it in GitHub Desktop.
#on branch with your commit that you need to split up
git checkout -b new_branch_name
git log -n1
#now record the sha hash of the last commit, lets call it SHA
#make sure you're on a new branch and you have no working directory changes
#this next command will wipe out everything and reset you to the previous commit
git reset --hard HEAD^
git cherry-pick SHA --no-commit
git add /filename/you/_want_/to/pull/request
git commit
git push origin new_branch_name
#make pull request from new_branch_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment