Exclude certain file patterns from rename detection in git?

独自空忆成欢 提交于 2021-02-08 06:35:59

问题


Question

Is it possible to exclude certain file patters from rename detection when doing merges with git?

Background

With our system, Salesforce.com, some metadata files are exactly identical, except for name. Because of this (I believe) merges can get a bunch of conflicts, e.g. if a meta file was deleted in one branch, and a different meta file with an identical body is deleted in another, it sees things as a rename and conflict with one added on deleted.

I know I can tweak the sensitivity of the rename matching, but if they're identical that doesn't seem like it would be of any benefit. I've searched the man pages and nothing is jumping out at me. Has anyone had this issue and has suggestions for how to address?


回答1:


See if that content matching detection would still happen during your merge if, before the merge, you did a:

git update-index --skip-worktree -- yourMetadataFile

(As mentioned in "Preserve git --assume-unchanged files between branch checkouts")



来源:https://stackoverflow.com/questions/22584734/exclude-certain-file-patterns-from-rename-detection-in-git

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