how to remove old commits from Gerrit repo?

1,137 views
Skip to first unread message

philipp...@gmail.com

unread,
Jul 21, 2015, 11:50:40 AM7/21/15
to repo-d...@googlegroups.com
Hi,

we used git svn to import an svn repository and its history into a repository in our Gerrit server. We have since added commits to the Gerrit project (there is new history there).

At some point in the past, large binary files were committed into the svn repo and subsequently deleted (but not purged). These assets persist in our git history and as a consequence the repository is unreasonably large.

We would like to remove these commits and purge the underlying assets, and retain our project and its history in Gerrit.

What is the recommended approach?

thanks

Phil


Edwin Kempin

unread,
Jul 21, 2015, 12:06:50 PM7/21/15
to philipp...@gmail.com, Repo and Gerrit Discussion
Have a look at [1].
It describes how you can identify and remove large objects from the history.
You should then force push the new history.
To physically remove the commits with large objects you must ensure that they are not referenced anymore and then run the git garbage collection (e.g. ensure that the commis are not referenced from the git ref log).
 

thanks

Phil


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bassem Rabil

unread,
Jul 21, 2015, 1:02:34 PM7/21/15
to repo-d...@googlegroups.com, philipp...@gmail.com
You may want to have a look as well on BFG tool [1].

Luca Milanesio

unread,
Jul 21, 2015, 5:02:09 PM7/21/15
to Bassem Rabil, repo-d...@googlegroups.com, philipp...@gmail.com
Thanks for sharing :-) This BFG seems really cool and fast !
What Git library uses to do the job? JGit?

Luca.

Matthias Sohn

unread,
Jul 21, 2015, 5:49:06 PM7/21/15
to Luca Milanesio, Bassem Rabil, Repo and Gerrit Discussion, philipp...@gmail.com
On Tue, Jul 21, 2015 at 11:01 PM, Luca Milanesio <luca.mi...@gmail.com> wrote:
Thanks for sharing :-) This BFG seems really cool and fast !
What Git library uses to do the job? JGit?

yes, BFG is using JGit

-Matthias 

Luca Milanesio

unread,
Jul 21, 2015, 6:08:11 PM7/21/15
to Matthias Sohn, Bassem Rabil, Repo and Gerrit Discussion, philipp...@gmail.com
That’s why is so fast then ;-)

JGit rocks !!

Luca.
Reply all
Reply to author
Forward
0 new messages