星期二, 5月 01, 2018

[git] 檔案移除版控

之前把某個 Project 送進版控時,該 Solution 沒有 .gitignore 檔案,最近有新專案也放進該 Solution 內,build 時才發現為什麼會有 bin 資料夾內的 change 產生阿,把 .gitignore 建立後也還是會有,查資料發現檔案進入版控後,建立或修改 .gitignore 檔案,必須手動把檔案從版控內移除並 commit 才算真的移除

建立 .gitignore 檔案後,build 後 bin 資料夾內還是會有 change 出現

[git] 檔案移除版控-1

git rm --cached WindowsFormsApp2/bin/Debug/\*

[git] 檔案移除版控-2

git status

[git] 檔案移除版控-3

git commit -m "Remove Version Control"

[git] 檔案移除版控-4

再進行 build,bin 資料夾內就不會再有 change 出現啦

沒有留言:

張貼留言