1

I am in the middle of a major code refactoring.

I use git for versioning.

  • The first commit introduces major changes.
  • Another commit adds new feature based on the new changes.
  • The third commit renames a major file and adds a few minor accompanying changes.
  • The fourth commit does another set of big changes to all the previously touched files based on feedback from code review.

Is there any trick to avoid the massive amount of conflicts when I split the last commit into 3, reorder commits and squash them so I only have the first 3 commits?

1
  • @MotiKorets is that any different/better from forced rebase? I was looking for a way to make forced rebase more automatic, not less. Commented Apr 21, 2018 at 15:27

1 Answer 1

1

You can set the rerere flag.

git rerere

git rerere is an internal mechanism for saving resolved conflicts.

Once the flag is enabled every time you resolve a conflict git store the result patch file inside the .git/rr-cached folder and next time it will "find" the same conflict it will resolve it automatically for you.

Setting up rerere

git config --global rerere.enabled true 

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.