.gitignore NuGet exclude packages/ include packages/repositories.config
问题 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? 回答1: /packages/ !packages/repositories.config You can also add a .gitignore in the