git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: can I use multiple worktree in same git repo ?

From
Sergio <sergio.callegari@gmail.com>
Date
Jul 22, 2011, 09:06 UTC
Message-ID
<loom.20110722T105732-905@post.gmane.org>
In-Reply-To
<201107212050.20108.jnareb@gmail.com>
Jakub Narebski <jnareb <at> gmail.com> writes:
Show 18 quoted lines
> 
> On Thu, 21 Jul 2011, Fredrik Gustafsson wrote:
> > On Thu, Jul 21, 2011 at 11:17:57AM -0700, Jakub Narebski wrote:
> 
> > > Actually with git-new-workdir you can have multiple working
> > > directories associated with single repository, by the way of symlinks.
> > > 
> > > Note however that if you intend to *work* in those workdirs, they
> > > better correspond to different branches... or you can mess something
> > > heavy.
> > 
> > It would be possible to use the .git-file feature here. Then symlinks are
> > avoided and the solution is portable.
> 
> Actually it wouldn't.  Each new workdir has a separate HEAD and a
> separate index; it is contents of .git that is symlinked, not .git
> itself.
> 

Is there any means to separate worktree info from the object repository? E.g., having a .git dir identical to that of a bare repo and a .git_workdir dir with the head, head logs, index and all what makes a nonbare repo different from a bare one? That might make it easier to transform a repo from bare to nonbare in addition to simplifying the logic of git-new-workdir.

Previous: Jakub Narebski
Message 9 of 9 in “can I use multiple worktree in same git repo ?”
  1. J. BakshiJul 20, 2011
  2. Nguyen Thai Ngoc DuyJul 20, 2011
  3. J. BakshiJul 20, 2011
  4. Nguyen Thai Ngoc DuyJul 21, 2011
  5. J. BakshiJul 21, 2011
  6. Jakub NarebskiJul 21, 2011
  7. Fredrik GustafssonJul 21, 2011
  8. Jakub NarebskiJul 21, 2011
  9. SergioJul 22, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.