2

I'm pretty new with the whole .gitignore thing so I hope someone can help me out with this.

We're developing with Xamarin and we would like to ignore the packages/ folder except one file which is placed in different (sub)directories.

I would like to keep the following file:

/packages/SQLitePCL.raw_basic.0.8.2/build/Xamarin.iOS10/SQLitePCL.raw_basic.targets

But all the other folders and files inside /packages/ I would like to be removed.

I tried something like:

packages/
!packages/SQLitePCL.raw_basic.0.8.2/build/Xamarin.iOS10/SQLitePCL.raw_basic.targets

But I don't think this is the way to go.

Mittchel
  • 1,896
  • 3
  • 19
  • 37

1 Answers1

0

I think that your .gitignore file is correct.

But I think that you have to remove packages in the remote before adding packages to your .gitignore file by command:

git rm --cached packages
git push origin master

And make sure that .gitignore is located same parent directory with packages

In the better way, I think you should create a .gitignore located in packages with the content:

*
!SQLitePCL.raw_basic.0.8.2/build/Xamarin.iOS10/SQLitePCL.raw_basic.targets
!.gitignore
Nguyen Sy Thanh Son
  • 5,300
  • 1
  • 23
  • 33