threads / discuss / 15402

Howto forward workdir to HEAD

Subject: Howto forward workdir to HEAD

## tl;dr

3 messages between Sep 6, 2008 and Sep 7, 2008.

replies: 2people: 3as markdown or json

Thomas Koch· Sep 6, 2008, 21:32 UTC · lore
Hi,

I'm trying to setup an intranet Webapp using GIT for maintanance and backup. First I created a git repo on my working machine and imported the webapp, made some changes.

Then I created a normal, non-bare repo at the server and pushed from my local repo into the server repo, checked out branch "stable" and everything is fine.

Now I made a local change and pushed again, but the servers workdir is not automatically forwarded to the pushed state. How do I forward it?

Can I define a Hook that automatically forwards the workdir after a push, but only if the workdir is clean?

What do you think of this method to deploy a webapp?
Best regards,
-- 
Thomas Koch, Software Developer
http://www.koch.ro
Junio C Hamano· Sep 7, 2008, 06:58 UTC · re: Thomas Koch · lore

Re: Howto forward workdir to HEAD

Thomas Koch <thomas@koch.ro> writes:
> Now I made a local change and pushed again, but the servers workdir is
> not automatically forwarded to the pushed state. How do I forward it?
http://git.or.cz/gitwiki/GitFaq?action=show&redirect=GitFAQ#head-b96f48bc9c925074be9f95c0fce69bcece5f6e73
Tarmigan· Sep 7, 2008, 07:05 UTC · re: Thomas Koch · lore

Re: Howto forward workdir to HEAD

On Sat, Sep 6, 2008 at 2:32 PM, Thomas Koch <thomas@koch.ro> wrote:
Show 12 quoted lines
> Hi,
>
> I'm trying to setup an intranet Webapp using GIT for maintanance and
> backup. First I created a git repo on my working machine and imported
> the webapp, made some changes.
>
> Then I created a normal, non-bare repo at the server and pushed from my
> local repo into the server repo, checked out branch "stable" and
> everything is fine.
>
> Now I made a local change and pushed again, but the servers workdir is
> not automatically forwarded to the pushed state. How do I forward it?
Please read http://git.or.cz/gitwiki/GitFaq#head-b96f48bc9c925074be9f95c0fce69bcece5f6e73
> Can I define a Hook that automatically forwards the workdir after a
> push, but only if the workdir is clean?
>
> What do you think of this method to deploy a webapp?

Generally it is frowned upon. The recommended way it to have a script or build process that you run from the git repo to populate the workdir. In addition to the reasons mentioned in the FAQ, you probably also don't want your live website to be updated in some random order decided by git, but want to update it in a particular order to stay consistent for anyone who loaded it in the middle of the update. This is best controlled by your makefile/script.

-Tarmigan

← back to recent threads