執(zhí)行 git rm -r --cached "bin/" ,刪除文件的命令.
執(zhí)行 git commit -m" 刪除bin文件" ,提交,并加注釋
執(zhí)行 git push origin master ,提交到遠(yuǎn)程服務(wù)器
注:此刪除保留本地文件,如果刪除服務(wù)器文件可以不使用推送。
當(dāng)我們需要刪除暫存區(qū)或分支上的文件, 同時工作區(qū)也不需要這個文件了, 可以使用
git rm file_path
git commit -m 'delete somefile'
git push