0

It's potentially a duplicated topic but the solutions founded here doesn't look enough.

We have a project with ~190MB of code and a git folder with ~6GB and a lot of commits that are not interesting anymore.

Supose my commits looks like:

A, B, C...Y, Z, AA, AB...FC, FD...GO

How I can delete history from B to FC plus shrink git folder and get only:

A, FD...GO

I believe that after that all developers should clone the repo again to avoid conflicts.

Again, sorry if it's a duplicated topic but I'm a bit confused about all the solutions for this kind of problem.

Max Bündchen
  • 1,283
  • 17
  • 38

1 Answers1

2

To get rid of older history, you could make a clone using the --depth param:

git clone --depth NUMBER_OF_COMMITS_TO_FD file:///path/to/original newrepo
hek2mgl
  • 152,036
  • 28
  • 249
  • 266