Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove a directory from github?

I have a folder in vendor/plugins/ that I deleted and committed as a delete in my github. But the folder still exists on github.

How do I remove it from github as well? This..may be a submodule.. I'm not entirely sure.

like image 639
Trip Avatar asked Jul 23 '11 05:07

Trip


People also ask

Can we delete a folder directly on GitHub?

You can delete an individual file or an entire directory in your repository on GitHub. People with write permissions can delete files or directories in a repository.

How do I completely remove a directory in git?

Just run the rm command with the -f and -r switch to recursively remove the . git folder and all of the files and folders it contains. This Git repo remove command also allows you to delete the Git repo while allowing all of the other files and folder to remain untouched.

How do you delete a directory?

To remove a directory and all its contents, including any subdirectories and files, use the rm command with the recursive option, -r . Directories that are removed with the rmdir command cannot be recovered, nor can directories and their contents removed with the rm -r command.


2 Answers

Try this:

git rm -r vendor/plugins
git commit -m "Your comment here"
git push -u origin master

First deletes your directory
Second makes your commit
Third push your changes

like image 57
Rafael Carrillo Avatar answered Oct 01 '22 09:10

Rafael Carrillo


You could try git rm -rf vendor/plugins to recursively delete it. You will need to commit this again.

like image 21
Kristof Claes Avatar answered Oct 01 '22 08:10

Kristof Claes