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

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

 



On Wed, 20 Jul 2011 20:25:55 +0700
Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> wrote:

> On Wed, Jul 20, 2011 at 7:54 PM, J. Bakshi <joydeep@xxxxxxxxxxxxxxx> 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. But you can create a
> central, bare repository, then make several clones from that. Each one
> is checked out with different branches. You work on a clone and push
> to the central repo. The post-commit hook in the central repo will do
> pull from it, for example
> 
> for site in dir1 dir2 dir3; do
>     cd /var/www/$site && /usr/bin/git pull
> done
> 

Thanks for your response. I am afraid that I can't understand the approach clearly but I must say that I am hopeful to see a direction.
Obviously there will be a central git repo which will have its worktree under htdocs at the same server. That's why the post-receive 
hook will update the website after each push. But the issue is mapping the structure at git which is different than the structure at 
filesystem. And a push should reflect to its correct folder only.

[git]->[mysite]->dir1/trunk/src => physically map => htdocs/demo/dir1
[git]->[mysite]->dir2/trunk/src => physically map => htdocs/demo/dir2


Please tell me with little more clarification, how can I do this ?

-with kind regards

--
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]