First of all: credit to @EtanReisner for carefully looking into this and @RetoAebersold for providing the correct link
The problem is that with the following statement (not part of your .gitignore
), you blacklist both files and directories:
*
Now if you use *.*
like you did, that's normally not a problem, because most directories don't contain a dot (.
). Yours however does:
* .*
postgresql/9.3
So what happens is that all directories are blacklisted. In order to enable adding files in directories, you first need to whitelist these directories. You can do this with the oneliner:
!*.*/
In other words, whitelist everything that ends with a slash.
And now you can whitelist the files as well:
!*.conf
Note that whitelisting !**/*.conf
is not necessary (It is probably not even allowed, especially since two consecutive asterisks **
were only enabled in git 1.8.*).
A better configuration file thus reads:
*.* # Ignore all files
*~ # Ignore temp files
\#* # Ignore temp files
!*/
!*.*/
!.gitignore
!*.conf