Home > database >  How can I delete a folder from a git branch?
How can I delete a folder from a git branch?

Time:09-21

the folder to be deleted

I have already written git rm --cached -r 'hw 1, try 1', nevertheless the folder stayed in the master branch.

CodePudding user response:

Try this steps:

1) git rm -r 'hw 1, try 1'
2) git commit -m "your-comment-for-deletion"
3) git push origin <your-branch-name>

Note that if you just want to remove it from your git repository but not delete it from your local filesystem you should replace step number 1 with:

git rm -r --cached 'hw 1, try 1'      

** If the above steps doesn't work, try to force the deletion of the directory:

git rm -rf 'hw 1, try 1'
  • Related