一个最简单的做法,通过添加.gitattributes文件来完成

1 在要被合并的分支中设置 git config --global merge.ours.driver true设置git配置项merge不合并的具体分支上的内容的;

2 在要被merge的分支上创建.gitattributes文件,并且在文件中置顶不merge的文件名

detail.txt merge=ours
git add .gitattributes
git commit -m '...'
git push

3 回到要合并到的分支master,执行merge:

git merge dev

 

相关文章:

  • 2021-06-16
  • 2021-12-08
  • 2021-10-13
  • 2021-12-24
  • 2021-11-01
  • 2022-02-26
  • 2021-12-02
  • 2021-10-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2021-07-06
  • 2021-08-13
  • 2022-12-23
相关资源
相似解决方案