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

2014-11-25 Thread Olaf Hering
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 --mi

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

2014-11-14 Thread Andreas Schwab
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. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fin

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

2014-11-14 Thread Jakub Narębski
W dniu 2014-11-13 13:03, Olaf Hering pisze: > On Thu, Nov 13, Fredrik Gustafsson wrote: [...] Your setup looks familiar to me for a subversion user switching to git and trying to use git as subversion. The common usecase is not to have multiple worktrees but to do a checkout to the worktree you n

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

2014-11-14 Thread Olaf Hering
On Thu, Nov 13, Fredrik Gustafsson wrote: > That's one of the reason it's not recommended to push into a non-bare > repository. You should clone your repo-master with the --bare option to > avoid having a work dir there. Even if I do a fresh clone with --bare, the result can not be updated anymor

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

2014-11-14 Thread Olaf Hering
On Fri, Nov 14, Olaf Hering wrote: > On Fri, Nov 14, Fredrik Gustafsson wrote: > > > On Fri, Nov 14, 2014 at 11:14:27AM +0100, Olaf Hering wrote: > > > So my repo-master is now "bare". I pushed from repo-branchA into > > > repo-master and see my commits in both repos. But pushing from > > > repo-

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

2014-11-14 Thread Olaf Hering
On Fri, Nov 14, Fredrik Gustafsson wrote: > On Fri, Nov 14, 2014 at 11:14:27AM +0100, Olaf Hering wrote: > > So my repo-master is now "bare". I pushed from repo-branchA into > > repo-master and see my commits in both repos. But pushing from > > repo-master to the remote fails because repo-master d

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

2014-11-14 Thread Fredrik Gustafsson
On Fri, Nov 14, 2014 at 11:14:27AM +0100, Olaf Hering wrote: > So my repo-master is now "bare". I pushed from repo-branchA into > repo-master and see my commits in both repos. But pushing from > repo-master to the remote fails because repo-master does not have > outstanding remote commits. However,

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

2014-11-14 Thread Olaf Hering
On Thu, Nov 13, Fredrik Gustafsson wrote: > Thanks for sharing your notes! A few comments: > > On Thu, Nov 13, 2014 at 04:44:57PM +0100, Olaf Hering wrote: > > First clone the remote repository as usual. Then create a local branch for > > each remote branch that is supposed to be worked on: > > #

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

2014-11-13 Thread Jeff King
On Thu, Nov 13, 2014 at 05:08:19PM +0100, Johan Herland wrote: > Can you not do this much simpler with --reference? Like this: > > $ git clone --bare git://host/repo.git repo-master > $ git clone -b branchA --reference repo-master git://host/repo.git > repo-branchA > $ git clone -b branchB

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

2014-11-13 Thread Johan Herland
On Thu, Nov 13, 2014 at 5:03 PM, Fredrik Gustafsson wrote: > Thanks for sharing your notes! A few comments: > > On Thu, Nov 13, 2014 at 04:44:57PM +0100, Olaf Hering wrote: >> First clone the remote repository as usual. Then create a local branch for >> each remote branch that is supposed to be wo

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

2014-11-13 Thread Fredrik Gustafsson
Thanks for sharing your notes! A few comments: On Thu, Nov 13, 2014 at 04:44:57PM +0100, Olaf Hering wrote: > First clone the remote repository as usual. Then create a local branch for > each remote branch that is supposed to be worked on: > # git clone git://host/repo.git repo-master > # cd repo-

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

2014-11-13 Thread Olaf Hering
On Thu, Nov 13, Olaf Hering wrote: > So how can I reduce the disk usage needed for the four .git dirs above? > I looked around in the docs that came with my git-2.1.3 package, but > found nothing that answers my question. Maybe we can workout something > and add it to one of the existing docs. W

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

2014-11-13 Thread Roger Gammans
On Thu, 2014-11-13 at 12:14 +0100, Olaf Hering wrote: > How can I reduce the disk usage for multiple copies of the same repo? > > Up to now I just made copies like this, but since .git alone is already > 2GB it becomes expensive: > > # git clone git://host/repo.git repo-master > # cp -a repo-ma

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

2014-11-13 Thread Olaf Hering
On Thu, Nov 13, Roger Gammans wrote: > Note the first sentence of the second paragraph. > eg: > # git clone git://host/repo.git repo-master > # git clone repo-master repo-branchA > # cd repo-branchA > # git checkout -b branchA origin/branchA It fails right here because in this dir only "mast

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

2014-11-13 Thread Duy Nguyen
On Thu, Nov 13, 2014 at 6:14 PM, Olaf Hering wrote: > Since each .git is almost identical I wonder if there is a reliable way > to "share" it. The "git clone" man page mentions --shared as a dangerous > way to do things. It does not give an advice how to manage such cloned > trees. If you know wh

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

2014-11-13 Thread Olaf Hering
On Thu, Nov 13, Fredrik Gustafsson wrote: > On Thu, Nov 13, 2014 at 12:14:44PM +0100, Olaf Hering wrote: > > > > How can I reduce the disk usage for multiple copies of the same repo? > > You can use --local och --shared. As you say --shared can be dangerous. > If you don't understand the man pag

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

2014-11-13 Thread Fredrik Gustafsson
On Thu, Nov 13, 2014 at 12:14:44PM +0100, Olaf Hering wrote: > > How can I reduce the disk usage for multiple copies of the same repo? You can use --local och --shared. As you say --shared can be dangerous. If you don't understand the man page enough to know how you should manage your clones you

how to reduce disk usage for large .git dirs?

2014-11-13 Thread Olaf Hering
How can I reduce the disk usage for multiple copies of the same repo? Up to now I just made copies like this, but since .git alone is already 2GB it becomes expensive: # git clone git://host/repo.git repo-master # cp -a repo-master repo-branchA # cd repo-branchA # git checkout -b branchA ori