I'm trying to track down an error that was introduced somewhere in a certain commit. Unfortunately, that commit consists of a lot of files and I'm not sure where the problem arose. I'd like to do something like "git bisect", but that would only help if I could split the problem commit into a bunch of smaller commits.
I don't have any problem with creating a branch, reverting the problem commit, then re-applying it as a series of commits, but I don't know how to do that. Researching this question here on Stack Overflow results in a lot of answers related to rewriting the history (like this or this), which I don't want to do because the commit in question happened in the past and it's been pushed to a central repository.
How can I split a single commit modifying multiple files into a series of commits, one for each file?
Edit: maybe I haven't explained the question clearly enough.
I have a repository with commits that look like this
A --- B --- C --- D
Commit B is a problem. A bug was introduced and it's been narrowed down to commit B. But commit B consists of a large number of changes to a large number of files, so it's unclear exactly what caused the bug.
What I'd like to do is this:
A --- B --- C --- D --- revert B --- B1 --- B2 --- ... --- Bn
Where B1
, B2
, ... Bn
are commits of the individual files that were changed in commit B.
If I can get the problematic commit broken down, I can then use git bisect
to narrow down the problem further.
Is there a way to do this?