Thread (25 messages) 25 messages, 6 authors, 2016-06-15

git gc & deleted branches

flat view

From: Guido Ostkamp <hidden>
Date: 2016-06-15 22:44:35

Hello,

I'm trying to reclaim space from an abandoned branch (never involved in any merge) using 'git gc', but it doesn't appear to work:

  mkdir testrepo
  cd testrepo
  git init
  dd if=/dev/urandom bs=1024k count=10 of=file
  git add file
  git commit -a -m 'initial checkin'
  git checkout -b test
  dd if=/dev/urandom bs=1024k count=10 of=file
  git commit -a -m 'branch checkin'
  git checkout master
  du -s .    # returns 30960
  git branch -D test
  git gc
  du -s .    # returns 30916

Here I had expected ~20000 since the branch uses ~10000.

My config is

[gc]
        reflogExpire = 0
        reflogExpireUnreachable = 0
        rerereresolved = 0
        rerereunresolved = 0
        packrefs = 1

I also tried 'git-pack-refs --all' or 'git-pack-refs --prune' but to no avail.

What am I doing wrong?

Thanks for any hints.

Regards

Guido
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help