Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git cleanup/garbage collection on remote VSO git repository

We are trying to clean up the history of a git repository hosted on VSO/team services. Using bfg and git-filter-branch we removed about ~80% of stored objects by cleaning accidentally checken in packages folders etc.

After successfully rewriting the repository’s git history we force pushed to visualstudio.com but new clones of that repo seem to suggest that none of the objects were actually removed. We found hints here and there indicating that TFS does not perform any garbage collection on git objects.

Is that (still) true for VSO as well?

Any improvements planned?

Deleting and recreating the repository would probably be a workaround but doesn’t seem that elegant.

like image 601
Simon Opelt Avatar asked May 29 '17 06:05

Simon Opelt


People also ask

Which command runs the garbage collector in git?

The git gc command is a repository maintenance command. The "gc" stands for garbage collection. Executing git gc is literally telling Git to clean up the mess it's made in the current repository.

What does git GC prune do?

Essentially, git prune will be triggered by git gc. Git prune is used to delete Git objects that the git gc config has judged unreachable. Learn more about the git prune command.


1 Answers

Yes, it’s still true for VSTS (VSO) now. But git gc on the server is in our backlog, so it will be improved in the future.

The option for now is recreating a new repo and push again (as you mentioned).

like image 138
Marina Liu Avatar answered Oct 03 '22 06:10

Marina Liu