Re: How to have multiple working copy directories use the same repository?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alex Riesen <raa.lkml@xxxxxxxxx> wrote:
> Bill Priest, Thu, Oct 11, 2007 20:10:50 +0200:
> >   I've looked at the "git for CVS users" section in
> > the docs and this appears to create two repositories. 
> > Is there a way to have two working directories that
> > utilize the same repository?
> 
> Look for "alternates" in git's documentation. But read all the
> warnings regarding git-gc and git-prune. Make a note of ".keep" files.

Really I think Bill wants the contrib/workdir/git-new-workdir script.

Its downside is that it makes heavy use of symlinks under the
.git directory for the secondary working directories, and you do
have to watch out for committing changes to a branch when more
than one working directory has that branch as its current branch.
But otherwise it works very well for this use case.

Also you may get a few warnings from your HEAD reflog saying objects
no longer exist when you do a git-gc within a working directory.
This can happen for example if you use `git rebase -i` in a working
directory a few times and then later run git-gc from a different
working directory.  But since its just intermediate rebase state
its probably not that big of a deal to have it go missing.

You shouldn't run `git gc --prune` if any of the working directories
has staged but uncommitted changes in them.  Such changes are held
in the working directory's index, which will not be considered
as reachable (as it isn't visible to git-gc) and the objects will
be pruned.  That would not too be pleasant to debug.

Heh.  As you can see it has some "issues" with its use.  Its a very
powerful tool, but it does give you more than enough room to shoot
yourself in the foot.  Using it is like tieing a gun to your ankle,
keeping it aimed at your big toe at all times, with a string tied
to your wrist and the gun's trigger.  Reach too far and *bam*.
Which is why its still in contrib status.
 
-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux