A file was added to git on commit n. How do I add it instead to commit n-m?

Posted by carleeto on Stack Overflow See other posts from Stack Overflow or by carleeto
Published on 2010-04-20T02:26:39Z Indexed on 2010/04/20 2:33 UTC
Read the original article Hit count: 264

Filed under:
|
|

I have a branch. Half way through I noticed git was not tracking a file that it should have been and so I added it as part of a commit and continued with my work. Now, I'm doing a git bisect and all commits before the file was added do not build. So I'm thinking, I need to split the commit that added the file into two parts: the file add and the rest of the commit. I then need to re-order the commits so that the file add commit will be at the beginning of my branch. Is this the correct solution or is there a better way of doing it?

© Stack Overflow or respective owner

Related posts about git

Related posts about commit