Reputation: 1
Currently doing a clean-up in our repositories, I'm trying to remove unnecessary folders/files from the repo, tried researching and saw solutions like git filter branch but this command is just for a single file/folder and takes time. Is there a way I can remove multiple folders/files from our repo in just a single command because these are hundred of files/folders
Upvotes: 0
Views: 320
Reputation: 1672
The rm -r
command will recursively remove your folder:
git rm -r folder-name
And for files:
If you want to remove the file from the Git repo
and filesystem
, use:
git rm some_file.txt
git commit -m "remove some_file.txt"
But if you want to remove the file only from the Git repo:
git rm --cached some_file.txt
git commit -m "remove some_file.txt"
Upvotes: 1