I've modified several files in a folder and subfolders. I could add the top folder recursively but then i have several subfolders that are untracked, so every time I do the recursive add to stage changes, I have to untrack the subfolders with git rm -r --cached. Is there a better way to just stage the modifications that show up in git status, without tracking already explicitly untracked files?
meta-question: is it really a good idea that git add means two (or more) things? in this context, if the command to track files (git add) were not the same used for stage modifications (git add) then i would not have this problem in the first place
git add -u adds only modifications. Also consider adding files which you don't want to track to .gitignore file.
I think what you're looking for is
git commit -a
This will let you commit changes only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With