How to untrack committed file - 如果在git 上 untrack committed file

今日需要在 git 上去 gitignore 一個之前已經 commit 了既 file

我們可以使用以下 git command 去 untrack 之前 commit 左既 file

git rm --cached [filename]


git rm --cached appsetting.Development.json

之後在 .gitignore 上加入你想 ignore 的檔案名便可

Hope you find it useful

Chi Yau
Chi Yau
Software Engineer

Interested on Learning new stuff and experience sharing