In this tutorial, we are going to learn about how to delete a directory or folder from a remote and local git repository.
To delete a directory from git repository we need to use the
git command followed by
rm command ,
-r flag and name of your directory.
git rm -r myFolder
Now we need to use push our changes to remote git repository by using the below commands.
git commit -m 'myFolder is deleted' git push
Now our directory is removed both locally and remotely from Git.