Joshua
Joshua

Reputation: 1

Remove Multiple Folders/Files From Remote Repo

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

Answers (1)

amer
amer

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

Related Questions