The file was added to git in commit n. How to add it instead of nm?

I have a branch. Halfway through, I noticed that git was not tracking the file that was supposed to be, and so I added it as part of the commit and continued my work. Now I am doing git bisect and all commits are not built before adding the file. So I think I need to split the commit that added the file into two parts: the file will also add the rest of the commit. Then I need to reorder the commits so that the add commit file is at the beginning of my branch. Is this the right decision or is there a better way to do this?

+3
source share
1 answer

Separation and reordering seem to be the easiest way to do what you want.
It will be the same as:

  • labeling your current branch as "oldbranch"
  • reset branch to commit before adding file
  • add file and create new commit
  • reloading your old branch on top of this new "current branch"
0
source

Source: https://habr.com/ru/post/1741874/


All Articles