Let's say I have git commit history like this(newer -> older):
C -> B -> A
after C's commit, I came to realize that there is something wrong with A.Maybe a test case which is suppose to be in that commit,but actually it wasn't there. So how can I deal with this situation? Make a new commit and melt it into A?how?
Problem solved:
git checkout Agit checkout -b fixgit add filesgit commit --amendgit rebase fix masterA lot of persons will said to you to do rebase --interactive (which could be the solution) but if you plan to change some lines that had been changed in commits B or C, that will be a hell to use.
The another solution could be :
rebase --onto to rebase only commit B and C on the newly created branch (that you could delete after) If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With