# repository in different directories

4 messages from 2011-07-11 to 2011-07-12. Participants: Carlo Trimarchi, Steve Muadib, Holding, Lawrence.
Thread: https://gitlist.dev/t/27785

## Carlo Trimarchi, 2011-07-11 12:44

Subject: repository in different directories
Message-ID: <CABU6SG5uLXAsu0yXa1cmPAmte3WnsjaHN0r_D4c8C7W2tKJDHw@mail.gmail.com>
URL: https://gitlist.dev/e/CABU6SG5uLXAsu0yXa1cmPAmte3WnsjaHN0r_D4c8C7W2tKJDHw%40mail.gmail.com

```
Hi,
I'm using git to build a website using the Codeigniter php framework.
I work on my local machine and then push to a remote server. The whole
website would be divided in different directories. I have the webroot
in /home/carlo/public_html/ directory. Here I have an index.php, the
css files and images. Then, outside this directory, I have the
application folder with all the real php stuff. Suppose it is in
/home/carlo/ci/application.

I have the same configuration on the server. So, the workflow would be
that I work on my local machine, I change something in the application
folder, then something in some css file and then I have to sync
everything with the server. I can have two repositories, one for the
folder in the webroot and another one for the application folder, but
then I'd have to push twice. Is there a better or a good way to do all
this?

Thanks,
Carlo

```

## Steve Muadib, 2011-07-11 13:44

Subject: Re: repository in different directories
Message-ID: <20110711134456.GA45560@sherwood.local>
URL: https://gitlist.dev/e/20110711134456.GA45560%40sherwood.local
In-Reply-To: <CABU6SG5uLXAsu0yXa1cmPAmte3WnsjaHN0r_D4c8C7W2tKJDHw@mail.gmail.com>

```
# Carlo Trimarchi <mr.spoon21@gmail.com> writes:
> Is there a better or a good way to do all this?
> 
> Thanks,

Yeah: use static webpages without images. :-)

Ah, and for wrong: how about using one repository and setting up
a commit hook to move files to final places?

Regards...

```

## Carlo Trimarchi, 2011-07-11 14:07

Subject: Re: repository in different directories
Message-ID: <CABU6SG4=UiuM7Q1RkXxR1oJKP72Sk69Awq09+64VOra3ds5hmA@mail.gmail.com>
URL: https://gitlist.dev/e/CABU6SG4%3DUiuM7Q1RkXxR1oJKP72Sk69Awq09%2B64VOra3ds5hmA%40mail.gmail.com
In-Reply-To: <CACwv2A=d44+txUGGDxJRFHVps-eT5g_mWyA-WaKTXyyUFgix7g@mail.gmail.com>

```
On 11 July 2011 16:01, Allen Fogleson <afogleson@gmail.com> wrote:
> Why not just make /home/carlo the repository, it has all the right folder
> structure, then from the server you can pull, or you can git archive when
> ready to release and unarchive on the server

because I'm working on different applications and I need a repository
for each one of them

Steve Muadib
>Ah, and for wrong: how about using one repository and setting up
>a commit hook to move files to final places?

the commit hook should stay in the local or the remote machine?

```

## Holding, Lawrence, 2011-07-12 19:29

Subject: RE: repository in different directories
Message-ID: <A5E8E180685CEF45AB9E737A0107998009CB9B@cdnz-ex1.corp.cubic.cub>
URL: https://gitlist.dev/e/A5E8E180685CEF45AB9E737A0107998009CB9B%40cdnz-ex1.corp.cubic.cub
In-Reply-To: <CABU6SG4=UiuM7Q1RkXxR1oJKP72Sk69Awq09+64VOra3ds5hmA@mail.gmail.com>

```
On your machine and the server make hard links from the folders in the repository to the destination folders, that way when you check out the latest version then both locations are updated.

So have 
/home/carlo/dev.repo/.git
/home/carlo/dev.repo/public_html/ linked to /home/carlo/public_html/
/home/carlo/dev.repo/applications/ linked to /home/carlo/ci/application

you can then work in the same place as usual, but do your commits from the dev.repo folder.

My $0.02 solution.

-----Original Message-----
From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On Behalf Of Carlo Trimarchi
Sent: Tuesday, 12 July 2011 02:07
To: Allen Fogleson
Cc: git@vger.kernel.org
Subject: Re: repository in different directories

On 11 July 2011 16:01, Allen Fogleson <afogleson@gmail.com> wrote:
> Why not just make /home/carlo the repository, it has all the right folder
> structure, then from the server you can pull, or you can git archive when
> ready to release and unarchive on the server

because I'm working on different applications and I need a repository
for each one of them

Steve Muadib
>Ah, and for wrong: how about using one repository and setting up
>a commit hook to move files to final places?

the commit hook should stay in the local or the remote machine?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

```
