孤之前在notion記錄的隨筆,參考stackoverflow一名用戶的解決方式,現(xiàn)在搬過來
To untrack a single file that has been added/initialized to your repository, i.e., stop tracking file but not delete form your system use:
git rm --cached file name
To untrack every file that is now your .gitignore
:
First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
This removes any changed files from the index(staging area), then just run:
git add .
Commit it:
git commit -m ".gitignore is now working"