Dženan
Dženan

Reputation: 3395

Reorder commits past file rename in git

I am in the middle of a major code refactoring.

I use git for versioning.

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?

Upvotes: 1

Views: 413

Answers (1)

CodeWizard
CodeWizard

Reputation: 142044

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

Upvotes: 1

Related Questions