0

This is what I've done in my local git repository:

git checkout -b temp
// made some changes
git commit -am "Fix button color"
// made some changes
git commit -am "Fix button shadow"
git revert bda326fd1
git merge master
// fix conflicts
// made some changes
git commit -am "Fix button size"

Now, git log --oneline gives me this:

0da44b017 (HEAD -> temp) Fix button size
b54f819ed Merge branch 'master' into temp
66a6de811 Revert "Fix button shadow"
bda326fd1 Fix button shadow
d467f28f4 Fix button color

Now, before pushing changes to remote, I would like to completelly remove theese commits:

66a6de811 Revert "Fix button shadow"
bda326fd1 Fix button shadow

I wanted to use git rebase to drop theese 2 commits, but after doing: git rebase -i HEAD~5 I got an error:

Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".

It want me to fix conflict, that was already fixed in past. Why does that happen? It was fixed waaay before my work I've talked above.

dafie
  • 951
  • 7
  • 25
  • 2
    This is normal in Git: unless you tell it to do so, it will not remember and re-use previous resolutions. (There's debate on making the default "do remember and re-use" instead of "don't remember and re-use", so in general a lot of people think it's safe to turn this feature on. Just be sure you understand exactly how it works first!) – torek Jan 31 '22 at 05:05

1 Answers1

0

In your case, try and:

then resolve conflicts although the code looked the same.

Then try again your interactive rebase, to see if a trained and activate rerere would help.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I activaated `git rerere` and trained branch with script, but its not working. Still, conflicts arent not getting solved. – dafie Jan 31 '22 at 13:05
  • @dafie You might need to bite the bullet and, with rerere active, resolve those conflicts. Once that is done, such a resolution should not present itself again, considering you recorded those merge conflicts. – VonC Jan 31 '22 at 13:56