I\'m trying to create a .gitignore for a Visual Studio project that uses NuGet. It currently contains:
\\packages/* !packages/repositories.config
This works for me.
#NuGet packages !packages/repositories.config
(Same as @manojlds's answer except removed the star in the first line. That didn't work for me.)