Git new orphan branch delete all history reduce size

129 views Asked by At

I tried to clean up an old project starting over, but now the .git folder keeps all history files that I don't need.

I explain everything I did:

I started working on an old repository.

After a few months I started over the project. So instead of creating a new repository, I created a new orphan branch and start making commits.

When I had the first version ready, I wanted to clean up old stuff just deleting the branches (develop/master) and renaming the new branch to the same branches (develop/master again)

Everything is fine, the code and git history only have the new code. But I see the .git folder is too big the only way is this big is because is keeping all history. (The project codebase size is only 15MB. And the .git folder size is 800MB).

How can I delete old objects. I see on the internet a lot of git commands related with prune and other names, but no one helped me.

I only want the objects related with my first commit of the starting over project.

0

There are 0 answers