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

ぃ、小莉子 提交于 2019-12-24 06:37:54

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/42179093/forked-repository-resolving-the-same-merge-conflicts-every-time-i-sync-with-up

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!