How to stop tracking and ignore changes to a file in Git?

前端 未结 20 2248
梦谈多话
梦谈多话 2020-11-21 07:17

I have cloned a project that includes some .csproj files. I don\'t need/like my local csproj files being tracked by Git (or being brought up when c

20条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-21 07:47

    The problem may be caused by the order of operation. If you modified the .gitignore first, then git rm --cached xxx,you may have to continue to encounter this problem.

    Correct solution:

    1. git rm --cached xxx
    2. modified the .gitignore

    Order invariant!

    The .gitignore reload after modification!

提交回复
热议问题