How to delete directory/folder from a Git repository

How to delete directory/folder from a Git repository

In this post we will give you information about How to delete directory/folder from a Git repository. Hear we will give you detail about How to delete directory/folder from a Git repositoryAnd how to use it also give you demo for it if it is necessary.

we are going to learn about how to delete a directory or folder from a remote and local git repository.

Deleting directory in Git

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.

Example:

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.

Hope this code and post will helped you for implement How to delete directory/folder from a Git repository. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US