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 can use the
git command followed by
rm command ,
-r flag and the name of your directory.
git rm -r myFolder
Now, we need to push our changes to the 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.