Subject: Re: how to reduce disk usage for large .git dirs?

From: Olaf Hering <[email-masked]>
Date: Tue, 25 Nov 2014 15:32:59 +0100

On Fri, Nov 14, Andreas Schwab wrote:

> Olaf Hering <[email-masked]> writes:
> 
> > Even if I do a fresh clone with --bare, the result can not be updated
> > anymore with git fetch. What I'm doing wrong?
> 
> A --bare clone has no connection to its origin (there are no remotes).
> You want a --mirror.

Using --mirror for this purpose is dangerous because it will most likely
overwrite changes on the remote side. Fortunately I used 'git push --dry-run
origin' and the output was like:

To git://host/repo.git
 + abbrev1..abbrev2 branchA -> branchA (forced update)

Before that I pushed already to the remote repo without realizing where the
push goes to.

Looks like using the --bare option for cloning the master and then doing
something like "git clone --origin local_bare -b branchA --reference
repo-master git://host/repo.git repo-branchA" will work better.

Olaf