How to Remove Pushed Pods Folder from Git Repository

25 de diciembre de 2021
Posted in Tutorials
25 de diciembre de 2021 ricardo

If you (or someone else) have pushed a /Pods folder into the repository (or any other file that is not supposed to be there) by mistake, there’s a way to permanently remove the file(s) from the repo. The filter-branch option may be a little more complicated than doing rebase but it is very effective and will remove the files from all the branches.

Here’s the recipe to remove the Pods folder. You can change the file/path matching and also limit the command for range of commits

Step 1: filter-branch

git filter-branch --index-filter 'git rm --cached --ignore-unmatch Pods/*' --tag-name-filter cat -- --all

Step 2: push –force

git push --force

This will clean the unwanted Pods folder from the repository. It will not rewrite the log commits though and the commit messages will still be there.

,
Contact

Get Connected.

We welcome you to contact us for more information
about any of our products or services.

Let’s Talk About Your Project

Build a stronger connection with your users through memorable mobile experiences.

Let’s Talk About Your Idea

Give users the outstanding mobile experience they deserve.

Let’s Talk About Your Content

Stunning apps to grow and enrich your business.

made with ❤️

Contact