# ignore everything in current directory /* # !pattern now negates the "ignore everything" and keeps 'pattern' # keep .gitignore !.gitignore # keep mydirectory, along with everything inside it !mydirectory/