Gitignore all obj directories except .m and .h files inside them

Xamarin Studio being a piece of garbage I can't just add obj

to .gitignore because any .h and .m files generated for / via Xcode are stored somewhere in the obj directory of the respective projects, These .h and .m files should be tracked in the repository, otherwise the build may break for some team members.

How can I ignore the project projects obj directories except for the .h and .m files they contain?

I tried

obj
!*.h
!*.m

      

but the exclusion rules don't work. I saw in this case obj/*

, but when I change it:

obj/*
!*.h
!*.m

      

all obj directories and their contents are monitored.

How to simply ignore everything in all obj directories except .h and .m files?

+3


source to share


2 answers


The file is .gitignore

explicitly specified files .h

and .m

, while you want to include .h

and .m

files to the directoryobj

:

obj/*
!obj/*.h
!obj/*.m

      



Note that it is still necessary to track the corresponding files inside it git add obj

.

(tested with git 1.7.11.3 on RHEL 6.5)

+3


source


Have you tried the file .gitignore

suggested here: gitignore.io ? There is one for XamarinStudio, this might help you solve your problem.



Hope this link helps you.

0


source







All Articles