简体   繁体   中英

How to remove a folder within a github repo that was deleted locally?

I've multiple folders in one repo. Originally was working on folder3 and pushed commits. Then I decided to change the name of my folder3 to folder3A and pushed to github. Then I deleted the folder3 locally using rm -rf folder3 and then pushed the commit. Now the problem is none of the below commands work if i want to remove the folder3 in my github repo since the file is not found locally: git rm -r --cached folder3 , git rm -rf obj both gives this error: fatal: pathspec 'folder3' did not match any files . How do I remove just one folder that has been deleted locally but is still present on github?

Just add everything in that is in your directory right now and have github sync with your folder.

git add * 
git commit -m "removed a folder"
git push origin master

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM