當我們需要刪除暫存區
或分支
上的文件, 同時工作區也不需要這個文件了, 可以使用
1 git rm file_path 2 git commit -m 'delete somefile' 3 git push
當我們需要刪除暫存區
或分支
上的文件, 但本地又需要使用, 只是不希望這個文件被版本控制, 可以使用
git rm --cached file_path git commit -m 'delete remote somefile' git push
當我們需要刪除暫存區
或分支
上的文件, 同時工作區也不需要這個文件了, 可以使用
1 git rm file_path 2 git commit -m 'delete somefile' 3 git push
當我們需要刪除暫存區
或分支
上的文件, 但本地又需要使用, 只是不希望這個文件被版本控制, 可以使用
git rm --cached file_path git commit -m 'delete remote somefile' git push
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。