1

We have a npm module with a package-lock.json and we would like to set it that we always accept the incoming changes on this file as a policy across the team.

I realise that I can set .gitattributes in the repo to use a merge strategy for a particular file e.g.

package-lock.json merge=myStrategy

... however this references a strategy which has to be setup by each user since it lives in .git/config.

Is there a way to have it set so that it live in source control? This way anyone working on the project will automatically adopt the practice.

I have already found a strategy for accepting incoming that should work without having to include it in the path as described in this answer but this is not kept in source control and requires that new users run a command before use.

Brendan
  • 18,771
  • 17
  • 83
  • 114

0 Answers0