I use the following text in .gitignore to ignore everything except some files that I want to track.
# Ignore everything
*
# But not these files...
!.gitignore
!README.md
# ...even if they are in subdirectories
!*/
However, when i git add -A
, another README.md
file in one of the subdirectories are also tracked. How can I circumvent this?