git add adding ignored files

后端 未结 10 2259
不知归路
不知归路 2021-02-01 00:58

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.

10条回答
  •  感情败类
    2021-02-01 01:42

    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)

提交回复
热议问题