I understand I can create .gitignore files in directories and then add the directories, and those files to the project. However:
Is there a way of adding directories without having files in them?
- Apparently not, but one can programmatically create empty files in empty directories https://unix.stackexchange.com/questions/463044/recursively-create-empty-file-in-empty-sub-directories
Is there a way of automatically adding new files and/or directories whenever they are created, rather than running the
git add
command?- Apparently not, but one can programmatically add files, add a commit message, and push all in a single script How can I stage and commit all files, including newly added files, using a single command?