1

I have a directory structure where I want to include a /packages/ directory in just one section and ignore in the others. The problem is with nuget and Microsoft, I don't want to backup my packages, but another library requires it.

what might my .gitignore look like assuming I'm already ignoring all packages as follows:

# NuGet Packages Directory
####packages

but I dont want to ignore

/WebAPI/JavaScript/Packages
Peter Kellner
  • 14,748
  • 25
  • 102
  • 188
  • By “`..`”, do you mean something other than parent directory?! – Biffen Sep 03 '14 at 06:45
  • can you give a concrete example of your folder structure. I think your question title is contradicting your content. Or maybe you have .gitignore stored somewhere else than in your repo root? Don't recommend that. – eis Sep 03 '14 at 09:53

1 Answers1

0

As per Git: inverse ignoring (.gitignore) I think you can do this:

packages/
!../packages/

The second line "undoes" part of the first.

Community
  • 1
  • 1
John Zwinck
  • 239,568
  • 38
  • 324
  • 436