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

前端 未结 20 1734
梦谈多话
梦谈多话 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:39

    This is a two step process:

    1. Remove tracking of file/folder - but keep them on disk - using

      git rm --cached 
      

      Now they do not show up as "changed" but still show as

          untracked files in  git status -u  
      
    2. Add them to .gitignore

提交回复
热议问题