git add adding ignored files

后端 未结 10 2268
不知归路
不知归路 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条回答
  •  萌比男神i
    2021-02-01 01:44

    You can do

    git check-ignore -v --no-index path/with/unexpected/result
    

    to see why git add did or didn't add that path.

    git check-ignore docs.

    In particular, the point is you want to check what's actually getting added, not a directory.

    further, do find . -name .git. Submodules are nested repos, .gitmodules and the submodule command are handy but they're just there to help with them.

提交回复
热议问题