git分支合并时如何指定部分文件不合并
首先 我有AB俩个分支,A分支上有abcd四个文件 B分支上也有abcd四个文件 。我A分支合并到B分支上但又不能合并改动B分支上abcd原来的内容应该怎么做呢 各位大神帮帮忙。在网看了看 说可以在git上设置个.gitattributes文件 合并时忽略.gitattributes中的文件合并 但是我写了之后只有第一行的文件不被合并 其他的还是被合并掉了
下面是我的.gitattributes文件内容 和 git命令
.gitattributes文件内容:
drquery.config/pom.xml merge=ours
drquery.datasource/pom.xml merge=ours
pom.xml merge=ours
drquery.csf/com/asiainfo/billing/query/utils/WarmUpperStartUp.java merge=ours
使用的git命令:
git config --global merge.ours.driver true
echo 'drquery/drquery.config/pom.xml merge=ours' >> .gitattributes
echo 'drquery/drquery.datasource/pom.xml merge=ours' >> .gitattributes
echo 'drquery/pom.xml merge=ours' >> .gitattributes
echo 'drquery/drquery.csf//com/asiainfo/billing/query/utils/WarmUpperStartUp.java merge=ours' >> .gitattributes
git add .gitattributes
git commit -m '11111s'