0

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?

Deke
  • 4,451
  • 4
  • 44
  • 65
  • Maybe this would be helpful? http://stackoverflow.com/questions/25458306/git-rm-fatal-pathspec-did-not-match-any-files – Qumeric Jun 26 '16 at 16:11
  • Did you checkout the branch before trying to remove? Run git checkout branchname and then remove. – dmitryro Jun 26 '16 at 16:12
  • I'm confused when you say that you *"decided to change the name of my folder3 to folder3A ... Then I deleted the folder3"* Does that mean that you made a copy of `folder3` as `folder3A`? – Jeff Puckett Jun 26 '16 at 16:28

1 Answers1

1

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
andrralv
  • 810
  • 7
  • 18