Git command to add / change modified files in folders only

I changed several files in the folder and subfolders. I could add the top folder recursively, but then I have several subfolders that are not tracked, so every time I make a recursive addition to scene changes, I need to track the subfolders with git rm -r --cached. Is there a better way to simply compose the changes displayed in git status without tracking already explicitly tracked files?

meta-question: is it really a good idea that ` git add` means two (or more) things? in this context, if the command for tracking files ( git add) was not the same for scene modifications ( git add), then I would not have this problem in the first place

+3
source share
2 answers

git add -uonly adds changes. Also consider adding files that you do not want to track in the .gitignorefile.

+17
source

I think you are looking

git commit -a

This will allow you to commit changes only.

+3
source

Source: https://habr.com/ru/post/1768862/


All Articles