git move partial changes across commits - MarekBykowski/readme GitHub Wiki
Say you have file1 changed in a few last commits.
If you want to merge the changes into one commit you have to:
git log -p -- file1-
git rebase -i <SHA1-1>to include theSHA1of interest - mark the
SHA1having the change on thefile1e - git will stop rebasing on the
SHA1 git reset HEAD~1git add file1; git commit -s file1- then repeat for the other files, spliting it into as many commits as wanted
You end up here with a separate commit on a file1 and the remaining. Break down is done
git rebase --continue- then see the history, rebase and squash the changes on a
file1to have one commit