I have a repository with over 35.000 commits at master. It's huge at storage (over 14 GB), and I want to remove all older commits than 6 months and keep all the changes. I mean, I dont need f.ex. 30.000 history commits, I just want to keep last 5.000. Do you have any solution to make it happen?
I was wondering about creating new repository from existing with HEAD^5000
, then try to pull the rest, but I dont know if it will work. Also was thinking about editing .git
directory, but it may be not easy at all.
It might work with rebase/squash, but can I do it historical and I wont have conflicts when I will pull master to develop/feature, or any current merge requests?