Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should github repo also have nuget packages folder?

What are the advantages / disadvantages OR the standard practice of including packages in your github repo?

like image 807
Bilal Fazlani Avatar asked Sep 11 '15 05:09

Bilal Fazlani


2 Answers

It has disadvantages similar to including produced code like the binaries the project itself produces; anyone updating the packages will now have a bunch of commits to do, which will potentially conflict with those done by someone else who updated the packages, and it can get very messy for zero gain.

I normally have the following in my .gitignore for .NET projects:

packages/**/*
!packages/repositories.config

That is, it ignores all of the contents of any folder called "packages" except for the repositories.config, which gets included in the repo, so any cloned repository has all it needs to restore the needed packages from nuget.

like image 79
Jon Hanna Avatar answered Oct 13 '22 00:10

Jon Hanna


I think that the best practice is to omit nuget packages. There is central source where you always can get package of given version (nuget itself), so there is not much sense to bloat your git repostory with them. Every developer can use Automatic Package Restore feature (see https://docs.nuget.org/consume/package-restore), to automatically download any missing nuget packages on build. Article above from nuget docs also shows you how to correctly setup things for this.

like image 29
Evk Avatar answered Oct 13 '22 00:10

Evk