When pulling from git I get problems like:
error: Your local changes to the following files would be overwritten by merge:
ElectronClient/package-lock.json
Please commit your changes or stash them before you merge.
error: Your local changes to the following files would be overwritten by merge:
CliClient/package-lock.json
Please commit your changes or stash them before you merge.
Apparently, these files are modified by the build process. But if it is a generated file, should it be in git?
Although these files are modified by the build process, his file contains dependencies of node modules and so should actually be in git. I think you are getting confused since there is actually very little build process in an interpreted language like Javascript, unlike C++. Only some transpiling and some bundling.
Nevertheless, when I pull and build, a subsequent pull will fail.
Yes, so you must commit the changes you made to package-lock.json
. Read the error message.
You can reset the package-lock files before pull. In general they should only be committed if you have changed the associated package.json.