git rm 簡單說明
git rm 是什麼?
- 從 Git 版本控制中移除檔案,並可選擇同時刪除檔案本身。
基本用法:
- 從 workspace 和 staging 移除檔案,並加入刪除的變更到 staging。
常用範例:
-
移除並刪除檔案:
-
只從 Git 中移除,但保留檔案在 workspace:
-
移除整個目錄:
影響的區域:
git rm會影響 workspace 和 staging,最終git commit後會影響 local。
常見搭配:
-
查看移除狀態:
-
提交刪除:
git rm 幫助你從 Git 中移除檔案,無論是刪除檔案或只移除版本控制,都非常實用! 😊