Dale Worley於 2014年12月27日星期六UTC+8上午4時37分08秒寫道:
> <dcg...@gmail.com <javascript:>> writes: 
> > 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 
> information. 

  I am pretty sure most of the files are the same by git diff.
  There is only small parts of the code base differ. 

  Just like you said, I expect only slight size increase with the new 
branch pushed.
  However, the repository doubled the size from 4G to 8G. Just as twice as 
the original size.      

> > 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=<date> 
>            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: 
> [core] 
>         logallrefupdates = false 
> [gc] 
>         pruneexpire = now 
  Thanks.  I will try to clean up my repository using these suggestions.

> Dale 

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 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to