How to Delete Folders from Git repos

How to Delete Folders from Git repos

Cameron McKenzie

54 года назад

40,857 Просмотров

Have a folder that you want gone from your Git repository? Do you want to remove the Git folder in GitHub too? And do you want to delete the folder only in the Git repository, or do you want the folder to remain on the filesystem with all of the files left in tact?

The deletion of a folder in a Git repository is not a hard problem to solve. Just run the following Git folder removal command:

git rm --cached -r foldername

With --cached added to the Git folder remove command, the folder will not be deleted from the filesystem. If you leave the --cached option out, the you will delete both the Git folder and the folder on the local filesystem as well.

Тэги:

#cameronmcnz #theserverside #java #jakarta #jakartaee #git #github #gitlab #delete #folder #bitbucket #gitops #devops #devopstools #gitopstools #dvcs #versioncontrol
Ссылки и html тэги не поддерживаются


Комментарии: