Git merge conflict to always take the newest file

后端 未结 4 1304
忘了有多久
忘了有多久 2020-12-09 21:04

How can I make a git conflict ALWAYS get resolved by taking the newest file (latest changed timestamp), completley without a prompt?

I am building a syncscript with

4条回答
  •  执念已碎
    2020-12-09 21:26

    If anyone came here searching for a solution to avoid resolve conflicts arose from automatically generated files such as package-lock.json, pubspec.lock, *.pbxproj, then you can create a .gitattributes file defining a merge strategy

    package-lock.json merge=union
    

    See more info on git attributes

提交回复
热议问题