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

Re: Managing websites with git

From
David Bryson <david@statichacks.org>
Date
Nov 30, 2008, 17:07 UTC
Message-ID
<20081130170722.GJ6572@eratosthenes.sbcglobal.net>
In-Reply-To
<fe5a74300811300830x850d81csc5cf1f9b367bac11@mail.gmail.com>
Hello,
On Sun, Nov 30, 2008 at 05:30:30PM +0100 or thereabouts, Felix Andersen wrote:
Show 8 quoted lines
> Hi!
> 
> Is it a bad idea to manage websites (php/xhtml/css) by having a origin
> non-bare repo in the hosted dir with the hook mentioned here:
> http://git.or.cz/gitwiki/GitFaq#head-b96f48bc9c925074be9f95c0fce69bcece5f6e73.
> I was thinking about any security issues with the .git dir being
> hosted. Or is that even the right way to do it?
> 

One really should not push to a non-bare repo. IIRC there was a patch recently to disallow it, but I do not remember if it was merged into HEAD.

Since I knew the patch was coming I rewrote my scripts to use a bare repo in /var/git, and push the changes to /var/www whenever I push to the remote repo.

I wrote my post-update to be something like the following.

#!/bin/bash LIVE="/var/www/statichacks/blosxom"

ref=$1

cd $GIT_DIR echo "Pushing updates to $LIVE..." git archive --format=tar $ref | tar -C $LIVE --atime-preserve -xpf -

There may be an easier way to do it, but that script took me about 5 minutes to write and test.

Dave
Previous: Felix AndersenNext: Jeff King
Message 2 of 10 in “Managing websites with git”
  1. Felix AndersenNov 30, 2008
  2. David BrysonNov 30, 2008
  3. Jeff KingNov 30, 2008
  4. Jason RiedyDec 2, 2008
  5. Jeff KingDec 2, 2008
  6. Jason RiedyDec 2, 2008
  7. Jeff KingDec 2, 2008
  8. Junio C HamanoDec 2, 2008
  9. Leo RazoumovDec 2, 2008
  10. Todd A. JacobsJan 3, 2009

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.