# Problem with architecture git.

3 messages from 2015-07-17 to 2015-07-17. Participants: Alexander, Zoë Blade, Keller, Jacob E.
Thread: https://gitlist.dev/t/39873

## Alexander, 2015-07-17 15:12

Subject: Problem with architecture git.
Message-ID: <loom.20150717T170829-906@post.gmane.org>
URL: https://gitlist.dev/e/loom.20150717T170829-906%40post.gmane.org

```
Hello,

I have problem with architecure of my project, help me to resolve problem 
. I want to do in my remote repo two branches with two different working 
folders (master , dev ) to check it . How can I do it ?

Thank you. 

```

## Zoë Blade, 2015-07-17 17:10

Subject: Re: Problem with architecture git.
Message-ID: <7C98A500-2464-4409-B3EA-8E60325674EA@bytenoise.co.uk>
URL: https://gitlist.dev/e/7C98A500-2464-4409-B3EA-8E60325674EA%40bytenoise.co.uk
In-Reply-To: <loom.20150717T170829-906@post.gmane.org>

```
On 17 Jul 2015, at 16:12, Alexander <samarinav1992@gmail.com> wrote:

> Hello,
> 
> I have problem with architecure of my project, help me to resolve problem 
> . I want to do in my remote repo two branches with two different working 
> folders (master , dev ) to check it . How can I do it ?
> 
> Thank you. 

You'll probably want something like this in your remote (presumably bare) repo's post receive hook:

#!/bin/sh

GIT_WORK_TREE=/var/www/html/www.foo.com git checkout master -f
GIT_WORK_TREE=/var/www/html/www.foo.com git clean -f
GIT_WORK_TREE=/var/www/html/dev.foo.com git checkout dev -f
GIT_WORK_TREE=/var/www/html/dev.foo.com git clean -f

It's one-way, from Git to the directories only, but should do the trick.

Hope that helps,
Zoë.
```

## Keller, Jacob E, 2015-07-17 18:06

Subject: Re: Problem with architecture git.
Message-ID: <1437156370.4883.14.camel@intel.com>
URL: https://gitlist.dev/e/1437156370.4883.14.camel%40intel.com
In-Reply-To: <loom.20150717T170829-906@post.gmane.org>

```
On Fri, 2015-07-17 at 15:12 +0000, Alexander wrote:
> Hello,
> 
> I have problem with architecure of my project, help me to resolve 
> problem 
> . I want to do in my remote repo two branches with two different 
> working 
> folders (master , dev ) to check it . How can I do it ?
> Thank you. 

Sounds like you want the git worktree functionality currently being
baked.

git clone <remote>
cd <repo>
git checkout master
git worktree add <path/to/dev> dev

This allows you to have both master checked out at the location
path/to/dev and the master checked out where repo is stored. Quite
valuable

I think this solves what you're looking for? I don't know what version
git-worktree is supported by..

Regards,
Jake

```
