It is easy.
tell .gitignore ignore everything except .gitignore and the folders you want to keep. Put .gitignore in the folders you want to save in the repo.
The contents of the top .gitignore :
# ignore everything except .gitignore and folders that I care about: * !images* !.gitignore
In the images subfolder, this is your .gitignore :
# ignore everything except .gitignore * !.gitignore
Please note that you must specify the names of folders in .gitignore that you do not want to ignore in the folder where this .gitignore is located. Otherwise, they are obviously ignored.
Your folders in the repo will obviously NOT be empty, as each of them will have .gitignore , but this part can be ignored, right. :)
ddotsenko Jan 26 '13 at 11:50 2013-01-26 23:50
source share