+3 votes
in General IT Tips by (71.8k points)
How can I delete a folder present in the master folder of the Github repository?

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

To remove a directory from both the Github repository and local machine, use the following three commands:

git rm -r YOUR_DIRECTORY
git commit -m "Remove the directory"
git push origin <your-git-branch> (typically 'master')

To remove a directory from the Github repository but not from the local machine,use the following three commands:

git rm -r --cached YOUR_DIRECTORY
git commit -m "Remove the directory"
git push origin <your-git-branch> (typically 'master')


...