How to add project.lock.json file in gitignore

I am trying to do something like below:

#DNX project.lock.json 

and

 *.lock.json 

but it does not seem to ignore these files.

+8
git gitignore
source share
2 answers

If the file is already being tracked on git, you must first delete it (the physical file must be placed in the git folder for a while), commit the changes and add the file to the folder again. Then git will start to ignore it using your instruction.

+12
source share

from https://docs.microsoft.com/en-us/nuget/schema/project-json :

The project.lock.json file is generated during the recovery process of NuGet packages in projects that use project.json. It contains a snapshot of all the information that is generated as NuGet, a package schedule and includes the version, contents and dependencies of all the packages in your project. The build system uses this to select packages from a global location that matter when building a project, and not depending on the local package folder in the project itself. This leads to faster assembly performance, since you only need to read project.lock.json instead of many separate .nuspec.

The .lock.json project is automatically created when the package is restored, so it can be excluded from source control by adding it to .gitignore and .tfignore. However, if you include it in source control, a change history will show the changes in the dependencies resolved over time.

+1
source share

All Articles