I have a repository with various commits which I want merged in two patches. One patch introducing the feature and another changing the existing code to use it. Problem is, when I was coding and committing I didn't have that in mind, so there are commits which do both. How can I split these commits?
I know that somehow I can do it with git rebase -i and picking edit for each commit I'd like to change, but this way I can only change the commit message, not the code