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

Re: Managing websites with git

From
Jeff King <peff@peff.net>
Date
Nov 30, 2008, 17:27 UTC
Message-ID
<20081130172717.GA7047@coredump.intra.peff.net>
In-Reply-To
<20081130170722.GJ6572@eratosthenes.sbcglobal.net>
On Sun, Nov 30, 2008 at 09:07:22AM -0800, David Bryson wrote:
> 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.

It's in master and should be in 1.6.1, but it is a config option that defaults to "warn" for now, so as not to break existing setups. It may switch to "refuse" after a deprecation period, but I don't think the length of that period has been set.

> 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.

Personally, I think that is a sane way to go; but note that you still use a non-bare repo with a checkout hook by explicitly setting receive.denyCurrentBranch to false.

Show 11 quoted lines
> #!/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.

One disadvantage of this method is that it doesn't remove files from $LIVE that were deleted in the repository.

-Peff
Previous: David BrysonNext: Jason Riedy
Message 3 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.