Github delete folder-How to remove a directory from git repository?

542    Asked by DanPeters in Devops , Asked on Feb 2, 2021
Answered by Dan Peters

Remove directory from git and local

You could checkout 'master' with both directories;

git rm -r one-of-the-directories

git commit -m "Remove duplicated directory"

git push origin

Here, is typically the 'master' branch, but not always/

Remove directory from git but NOT local

If you want to remove this directory from git but not delete it entirely from the filesystem (local system)

In that case, you have to use:

git rm -r --cached myFolder



Your Answer

Interviews

Parent Categories