0 votes
1 view
in Devops and Agile by (28.1k points)

I have 2 directories on my GitHub repository. I'd like to delete one of them. How could I do that without deleting and re-creating the entire repository?

1 Answer

0 votes
by (48k points)

To remove a directory from git and local can be done using 

git rm -r directory-name

git commit -m "Remove duplicated directory"

git push origin <your-git-branch> (In most cases it will be master but not in all cases).

You may also look for deleting the directory from git but not from the local file system. For that use

git rm -r --cached myFolder

This will remove the directory from git but not from the local file system.

Reference: https://git-scm.com/docs/git-rm#Documentation/git-rm.txt--r

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...