Git ignore except specific subdirectories

I've looked at some examples on how to ignore everything except certain sub directories like so.

# Ignore Everything
# Include sub directory

I have also tried:

# Ignore Everything
# Include sub directory


So the code above works, however trying to exclude a directory within another directory within another does not work. It only works on the parent directory and sub directory.

# Ignore Everything
# Include sub directory

After I include this in my gitingore, I run a git add --all and I dont see any the files in git status.

All help would be appreciated.


You have to unignore every directory in the path that you wish to unignore. Something like the following should work in your case:

# Ignore everything in foo
# Except the ccc subdir

# Ignore everything in ccc subdir
# Except the aaa subsubdir

# Ignore everything in aaa subsubdir
# Except the ddd subsubsubdir

It's important that the ignore rules end in /*, as that tells git to ignore everything in the folder, but not the folder itself, permitting us to add exceptions to the ignore rules for specific subdirectories.

Need Your Help

Anybody successful with NSProxy of UIView (e.g., UILabel?)

iphone uiview uilabel calayer nsproxy

I am experimenting in adding functionality to my UIViews (configuring CALayers according to state) by setting up a NSProxy subclass to stand in for any UIView I choose. Here's what I've tried:

Python weird behavior with multiple calls

python subprocess

I am trying to call remote (ssh) commands using the function like this.