从本地和仓库中都移除目录 git rm -r mydir git commit -m "remove this dir for something" git push origin master 仅仅从仓库中移除目录,但保留在本地 git rm -r --cached mydir git commit -m "remove this dir for something" git push origin master