How do I remove a directory from a Git repository?


How can I delete a single directory containing files from a Git repository?


Remove directory from Git and local

Checkout 'master' with both directories:

git rm -r one-of-the-directories // This deletes from filesystem
git commit . -m "Remove duplicated directory"
git push origin <your-git-branch> (typically 'master', but not always)

Remove directory from Git but NOT local

To remove this directory from Git, but not delete it entirely from the filesystem (local):

git rm -r --cached myFolder

Git error when trying to push -- pre-receive hook declined

How to keep a branch synchronized/updated with master?