git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Repo cleanup problem

From
EKEugine Kosenko <eugine.kosenko@gmail.com>
Date
May 11, 2007, 08:03 UTC
Message-ID
<9909dee80705110103h5b848490m296c001beecfa1f1@mail.gmail.com>
I'm sorry, if it is a FAQ.

I use git to track my own changes in a project, i.e, this is a private (not public) repository. Some time ago I've accidentally committed a big amount (about of 50M) of crap into the repository, and make a mature set of commits after this.

For now I'm looking for a way to remove the garbage commit. I've found a way to remove any commit using git-checkout, git-reset and git-rebase. But, when I even git-reset the repository to the very first (root) commit, I see the size is still large enough, i.e., the crap is still there. I've tried many combinations of git-gc, git-prune, git-repack, git-prune-packed etc, but the size of the repository is still the same. The only way I see now is to git-clone the repository -- the new one is essentially smaller, but needs to reconstruct the local branches.

Is this (make a clone) the only proper way to clenup a repository, or there is another magic tool to cleanup the repositories?

Next: Matthieu Moy
Message 1 of 4 in “Repo cleanup problem”
  1. Eugine KosenkoMay 11, 2007
  2. Matthieu MoyMay 11, 2007
  3. Karl HasselströmMay 11, 2007
  4. Eugine KosenkoMay 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.