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

Re: Multiple working trees with GIT ?

From
Willy Tarreau <w@1wt.eu>
Date
Jan 24, 2008, 12:59 UTC
Message-ID
<20080124125905.GC13247@1wt.eu>
In-Reply-To
<Pine.LNX.4.64.0801240947230.14173@reaper.quantumfyre.co.uk>
Hi Julian,

On Thu, Jan 24, 2008 at 09:59:05AM +0000, Julian Phillips wrote: (...)

Show 9 quoted lines
> >This works pretty well. I can simply cd worktree/variant_a and work on a
> >file, or pull master, or even git-cherry-pick from other branches (pretty
> >convenient for this usage). But I don't know what caveats I may encounter.
> 
> You might want to have a look at the git-new-workdir script in contrib, it 
> does basically the same thing.  It's been there for about 10 months now. 
> It was based on an email from Junio:
> 
> http://article.gmane.org/gmane.comp.version-control.git/41513/

Interesting lecture, thanks for the pointer. At least now I know that it is not too much exotic.

Show 5 quoted lines
> However, there are some caveats about using this approach, basically about 
> the fact that there is nothing stopping you from updating refs that are 
> currently checked out in another directory and causing yourself all sorts 
> of pain ... the topic has cropped up a couple of times on the list since 
> the script was added.

hmmm good point. Given that I'm used to push into remote working dirs and to get caught by this problem, I think I would most often escape from the caveat, but we should take care of not trapping newbies.

Show 10 quoted lines
> >Maybe there are other solutions too. I see that we tend to replace symlinks
> >everywhere with ref files. We might as well (in a far future version) 
> >accept
> >a file for ".git" which would contain a path to the central repo and the
> >branch's head.
> 
> There was a suggestion for something not too dissimilar even before the 
> new-workdir script:
> 
> http://thread.gmane.org/gmane.comp.version-control.git/33755

OK, thank you for your links. I still think I will wo the easy way for now, probably using git-new-workdir, waiting for a general consensus on the subject.

Regards, Willy

Previous: Willy TarreauNext: J. Bruce Fields
Message 7 of 8 in “Multiple working trees with GIT ?”
  1. Willy TarreauJan 24, 2008
  2. Julian PhillipsJan 24, 2008
  3. Johannes SchindelinJan 24, 2008
  4. Willy TarreauJan 24, 2008
  5. Johannes SchindelinJan 24, 2008
  6. Willy TarreauJan 24, 2008
  7. Willy TarreauJan 24, 2008
  8. J. Bruce FieldsJan 24, 2008

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.