From: Yakup Akbay <yakbay@ubicom.com>
To: git@vger.kernel.org
Subject: Confused about `git gc`
Date: Tue, 09 Jun 2009 11:28:39 +0300 [thread overview]
Message-ID: <4A2E1D37.9010909@ubicom.com> (raw)
Looks like I didn't quite understand the actual role of `git gc`. I just
thought that `git gc` would remove all unreferenced objects during the
unpack-pack process. However, I'm not seeing the result what I was
expecting from `git gc`.
I'm adding an object into the database, which is ignored by git. Then I
expect the object to be removed after `git gc`. But, it's still there.
Please follow:
$ echo "/ignored_file" > .gitignore
$ echo "This file is ignored by git. I'm sure that this content has
never been existed in the repository before." > ignored_file
$ git hash-object -w ignored_file
39cd40a92c0a92bbcbd74ec6879b4936212beebd
$ ls .git/objects/
07 39 9f b9 d0 fa info pack
$ ls .git/objects/39/
cd40a92c0a92bbcbd74ec6879b4936212beebd
$ git gc
Counting objects: 319, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (147/147), done.
Writing objects: 100% (319/319), done.
Total 319 (delta 124), reused 319 (delta 124)
$ ls .git/objects/39/
cd40a92c0a92bbcbd74ec6879b4936212beebd
As you see, 39cd40a92c0a92bbcbd74ec6879b4936212beebd is still there.
Shouldn't it be removed by `git gc`?
What am I overlooking?
Regards,
Yakup
next reply other threads:[~2009-06-09 10:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 8:28 Yakup Akbay [this message]
2009-06-09 10:45 ` Confused about `git gc` Jakub Narebski
2009-06-09 11:18 ` Yakup Akbay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A2E1D37.9010909@ubicom.com \
--to=yakbay@ubicom.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.