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

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

From
Fredrik Gustafsson <iveqy@iveqy.com>
Date
Jul 21, 2011, 18:22 UTC
Message-ID
<20110721182215.GA9505@kolya>
In-Reply-To
<m3sjpzsdll.fsf@localhost.localdomain>
On Thu, Jul 21, 2011 at 11:17:57AM -0700, Jakub Narebski wrote:
Show 20 quoted lines
> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> 
> > On Wed, Jul 20, 2011 at 7:54 PM, J. Bakshi <joydeep@infoservices.in> wrote:
> > > As a result whenever there is a commit , it updates the related folder in filesystem.
> > > Say a commit at svn->mysite-repo->dir1->trunk->src ==> modify ==> /var/www/demo/dir1
> > >
> > > Can I do the same in git with multiple worktree ? possible ?
> > 
> > Using multiple worktree with the same repo won't work in git because
> > the repo also have worktree-related information. [...]
> [...]
> > Also have a look at git-new-workdir in contrib directory of git
> > repository. I don't use it but you might find it useful.
> 
> 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.

Med vänliga hälsningar Fredrik

Previous: Jakub NarebskiNext: Jakub Narebski
Message 7 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.