从git的重命名检测中排除某些文件模式? [英] Exclude certain file patterns from rename detection in git?

查看:78
本文介绍了从git的重命名检测中排除某些文件模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与git合并时,是否可以从重命名检测中排除某些文件模式?

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

在我们的系统Salesforce.com中,除了名称之外,某些元数据文件是完全相同的.因此(我相信)合并可能会引起许多冲突,例如如果在一个分支中删除了一个元文件,而在另一个分支中删除了一个具有相同主体的其他元文件,则它将视为重命名,并且与在删除后添加的一个文件发生冲突.

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?

推荐答案

查看在合并之前,如果您执行了以下操作,是否仍会进行内容匹配检测:

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

(如"保留git-假定分支结帐之间未更改的文件"所述)

这篇关于从git的重命名检测中排除某些文件模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆