在网上找的:
在项目根目录下新建文件.gitattributes,然后文件中写入需要忽略的文件名 + merge=ours, 一个文件占一行 例:
忽略config.xml 文件
config.xml merge=ours
如果设置了没有起效,在根目录下运行命令行 git config merge.ours.driver true 进行config配置
.gitattributes该文件主要是用于设置git对特定文件进行配置属性的,还可进行其他的配置,具体大家可以去找找
.gitattributes文件
pom.conf merge=ours
pom.conf diff=nodiff
但是没冲突的时候还是会合并,配置文件不想每次合并都去修改
git diff master 没有pom.conf 但是git merge 还是会合并pom.conf 除非pom.conf文件冲突(只有第一次冲突有效),再merge的时候又合并了,如何在merge的时候忽略pom.conf。
不能再.gitignore里写,因为还要修改,自动化部署