Easier merges on lockfiles
Blog post from Aspect Build
Lockfiles, often updated when third-party dependencies change, can lead to merge conflicts during rebases if multiple contributors modify them simultaneously. This situation can be frustrating to resolve, especially in generated files, and not all package managers can automatically fix these conflicts. Git offers a solution through the use of .gitattributes and custom merge drivers. A specific strategy involves configuring Git to use a custom merge driver that defaults to the "ours" strategy, always selecting the local version of the file in case of conflicts. By adding a directive to the .gitattributes file to apply this custom merge driver to lockfiles, developers can avoid annoying merge conflicts and streamline the collaboration process.