记录.gitattributes 设置合并时使用本地文件无效的解决方案

#添加.gitattributes 目的: 合并时使用本地的composer.json文件
#注:只有两处分支都对composer.json有修改,即有冲突时才会使用此规则。-----merge=ours 我的理解是合并并且发生冲突时使用自己的composer.json文件,若仅仅是一处修改,那么将正常合并【未冲突】,则不会触发此规则
echo composer.json merge=ours > .gitattributes
#设置driver 是否全局生效,酌情使用--global
git config --global merge.ours.driver true

posted on   拙言者  阅读(1116)  评论(0编辑  收藏  举报

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示