Git取消已經被追蹤的檔案_Web.config

 

每次都會不小心在commit時候把web.config  給commit跟push進來
當中包含了一些機密性資料
發信依賴的gmail帳號密碼跟DB連線字串帳密等等
真的還滿頭疼的>~<

後來都要頻繁去更新密碼


趕緊記錄起來不要再犯這類錯誤
開啟git bash 然後cd到專案目錄
可以直接到Web.config所在目錄
下這行指令使其不再被版控追蹤
git rm --cached web.config


記得把.config補加進.ignore




Ref:
.gitignore not ignoring web.config
https://stackoverflow.com/questions/22038600/gitignore-not-ignoring-web-config


How to change folder with git bash?
https://stackoverflow.com/questions/8961334/how-to-change-folder-with-git-bash


留言

這個網誌中的熱門文章

經得起原始碼資安弱點掃描的程式設計習慣培養(五)_Missing HSTS Header

經得起原始碼資安弱點掃描的程式設計習慣培養(三)_7.Cross Site Scripting(XSS)_Stored XSS_Reflected XSS All Clients

(2021年度)駕訓學科筆試準備題庫歸納分析_法規是非題