[英]Remove Locally Deleted or Renamed Files and Directories from Remote Github Repo?
[英]How to remove a folder within a github repo that was deleted locally?
我在一個倉庫中有多個文件夾。 最初是在folder3上工作並推送了提交。 然后,我決定將folder3的名稱更改為folder3A並推送到github。 然后,我使用rm -rf folder3
folder3在本地刪除了folder3,然后推送了提交。 現在的問題是,如果我想在我的github存儲庫中刪除folder3,則以下命令都不起作用,因為在本地找不到該文件: git rm -r --cached folder3
, git rm -rf obj
都給出此錯誤: fatal: pathspec 'folder3' did not match any files
。 如何僅刪除一個已在本地刪除但仍存在於github上的文件夾?
只需立即添加目錄中的所有內容,然后讓github與您的文件夾同步即可。
git add *
git commit -m "removed a folder"
git push origin master
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.