Jorge
Jorge

Reputation: 315

Forked repository - Resolving the same merge conflicts every time I sync with upstream

I have forked a repository, but I'd like to keep it in sync with the upstream repository often. I have swapped some modules with my own implementation, so that means that every time I want to sync with the upstream repository, I keep getting the same merge conflicts over and over again.

My question is: Is there a way to tell Git to use my own implementation for these case, rather than marking it as merge conflict? Is there something that I can automatize here, so I don't run into the same issues over and over again?

Thanks.

Upvotes: 3

Views: 627

Answers (1)

j6t
j6t

Reputation: 13387

Use the rerere machinery ("reuse recorded resolutions"):

git config rerere.enabled true

If the exact same conflict turns up again that has been resolved (and commited!) earlier, its resolution is applied again. By default, you still have to confirm the resolution, but it does the grunt work for you.

rerere works only for content conflicts, not for add/modified or delete/modified conflicts.

Upvotes: 3

Related Questions