I want to be able to do the following:
$ pwd
/tmp/repo
$ ls -l
/a-dir
/another-dir
.gitignore
a-file
another-file
$ git add -A
<< ONLY .gitignore, a-file and another-file are added >>
How can I achieve that?
NOTE: More files and directories could be added as time goes on. The directories, and all of their contents should be ignored. Only the files residing in the repositories root directory should be included.
EDIT: I want to do this with the .gitignore file, so I don't have to remember to run a different command each time. I just want to keep it simple with git add -A
, and have the .gitignore take care of it.