From: Olaf Hering Date: Tue, 25 Nov 2014 14:32:59 GMT Subject: Re: how to reduce disk usage for large .git dirs? Message-ID: <20141125143259.GA9794@aepfle.de> In-Reply-To: <8761ehom8l.fsf@igel.home> On Fri, Nov 14, Andreas Schwab wrote: > Olaf Hering 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