> I have a git repository, which master is empty and a branch contains
> android 5.0.0_r1. (Yes, I packed all android git repository into one).
> Now I want to push android 5.0.2_r1 into the repository. I checkout the
> master git an empty work place. Then create a new branch called
> android_5.0.2_r1, put all file in it, add all file then commit.
> I found I have got a twice large size repository. This means even most the
> files are the same, git still store them as a new object. Just wonder why?
If two files contain *exactly* the same content, then they will be
stored as one blob. My guess is that most or all of the files are not
exactly the same in the two versions of Android. You can check this
with a command like "git diff branch1 branch2".
Eventually, even if the files are slightly different, they will be put
into pack files. Within pack files, the compression system will detect
that the files are mostly the same and remove much of the duplicate
> There are still some other questions. I already push the new branch to my
> Gerrit server. When I found the repository size doubled, I just delete that
> beanch from WebUI. Still the repository remains its size even I run git gc.
> How can I remove the branch and its commit completely?
git-gc doesn't remove information that has been added "recently", so
that it can be recovered from the reflogs. Look at the option
Prune loose objects older than date (default is 2 weeks ago,
overridable by the config variable gc.pruneExpire). This option is
on by default.
and also the configuration options:
logallrefupdates = false
pruneexpire = now
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.