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

can I use multiple worktree in same git repo ?

From
JBJ. Bakshi <joydeep@infoservices.in>
Date
Jul 20, 2011, 12:54 UTC
Message-ID
<20110720182438.3c40cf1d@shiva.selfip.org>
Hello list,
Please bear with me as I am from svn domain and gradually making myself aware of git.

I have a site under htdocs which is modified by svn with the help of post-commit hook. But the svn folder structure is little different than the actual structure at filesystem. Under htdocs/demo, say I have dir1, dir2 etc... where in svn I have the structure as

[svn]
mysite-repo
|
|----------dir1------|trunk----src (here actually I have the contents of dir1)
|----------|---------|tags
|----------|---------|branches
|
|----------dir2------|trunk----src (here actually I have the contents of dir2)
|----------|---------|tags
|----------|---------|branches

And in file-system dir1 is mapped with (checkout from) and then (svn switch --relocate) mysite-repo/dir1/trunk/src ; dir2 is checkout from and then (svn switch --relocate) mysite-repo/dir2/trunk/src and so on .....

Now the post-commit hook is tricky.

``````` #!/bin/bash

set -e
# LANG=en_US.UTF-8 for special character support
LANG=en_US.UTF-8 /usr/bin/svn up  /var/www/demo/dir1
LANG=en_US.UTF-8 /usr/bin/svn up  /var/www/demo/dir2

LANG=en_US.UTF-8 /usr/bin/svn up /var/www/demo/dir3 ````````````````

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 ?
Thanks
Next: Nguyen Thai Ngoc Duy
Message 1 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.