I\'m trying to remove a previously tracked directory from git, which works, but it\'s being added back with each subsequent git add ., git add -A, etc.
git add .
git add -A
Another approach if you don't want to use git rm --cached
rm -Rf node_modules git add -u git commit -m "stop tracking node_modules" npm install # done
Also note the distinction between node_modules and node_modules/ which you seem to have correct. (Thanks umläute for the note on this)