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 o...@aepfle.de 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.

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: # git

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, git

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 does not

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-master to the

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

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

2014-11-14 Thread Andreas Schwab
Olaf Hering o...@aepfle.de 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,

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

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

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 page

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 o...@aepfle.de 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

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 master

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-master

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.

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

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 iv...@iveqy.com 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

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