Use rm -r switch with the git command to remove directory recursively. After removing the directory you need to commit changes to the local git repository. Then push the changes to remove the directory from the remote git repository.
Use the command line below to remove the directory named test_dir from the current directory.
git rm -r test_dir
Then commit and push to apply changes in the local and remote repository.
git commit -m "Removed test directory" git push origin master # Change 'master' with your branch name
All done, The test_dir has been removed from the local as well as the remote git repository.