From 88defdf0fe7ae81b69575595d0fabb4f7e5d27cb Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Fri, 2 Dec 2022 15:14:03 -0800 Subject: [PATCH] chore: improve package-lock.json merging So what this does is treats `package-lock.json` as a text file _except_ when attempting to merge. The result will be that if `package-lock.json` is in a conflicted state, it will not contain conflict markers within the file itself like a regular text file would; it will only have the "conflicted" flag set by git. This means that to resolve a conflict in `package-lock.json` going forward, all one needs to do is run `npm install && git add -A package-lock.json`, as `npm` will fix `package-lock.json` itself. In theory. --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitattributes b/.gitattributes index 6313b56c5..20f58513c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,4 @@ * text=auto eol=lf + +# Handle as a text file but merge as binary. +package-lock.json merge=binary