.gitignore NuGet exclude packages/ include packages/repositories.config

git, gitignore, nuget

Solution

/packages/
!packages/repositories.config

You can also add a `.gitignore` in the packages folder:

*
!repositories.config
!.gitignore

Problem

I'm trying to create a .gitignore for a Visual Studio project that uses NuGet. It currently contains: ``` \packages/* !packages/repositories.config ``` This does not ignore anything in the folder. Everything gets staged on an add. I have also tried: ``` packages/ !packages/repositories.config ``` This ignores everything in the packages folder and does not include the packages/repositories.config. What am I doing wrong?

Original source

Related problems