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

Re: Howto forward workdir to HEAD

From
TTarmigan <tarmigan+git@gmail.com>
Date
Sep 7, 2008, 07:05 UTC
Message-ID
<905315640809070005r6183a5f7n351b9bfd4df76af5@mail.gmail.com>
In-Reply-To
<200809062332.39147.thomas@koch.ro>
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
Previous: Junio C Hamano
Message 3 of 3 in “Howto forward workdir to HEAD”
  1. Thomas KochSep 6, 2008
  2. Junio C HamanoSep 7, 2008
  3. TarmiganSep 7, 2008

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.