From: Jeff King <peff@peff.net>
To: David Bryson <david@statichacks.org>
Cc: Felix Andersen <felix@nibbo.se>, git@vger.kernel.org
Subject: Re: Managing websites with git
Date: Sun, 30 Nov 2008 12:27:17 -0500 [thread overview]
Message-ID: <20081130172717.GA7047@coredump.intra.peff.net> (raw)
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.
> #!/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
next prev parent reply other threads:[~2008-11-30 17:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-30 16:30 Managing websites with git Felix Andersen
2008-11-30 17:07 ` David Bryson
2008-11-30 17:27 ` Jeff King [this message]
2008-12-02 0:46 ` Jason Riedy
2008-12-02 1:11 ` Jeff King
2008-12-02 15:55 ` Jason Riedy
2008-12-02 16:55 ` Jeff King
2008-12-02 19:07 ` Junio C Hamano
2008-12-02 1:36 ` Leo Razoumov
2009-01-03 21:29 ` Todd A. Jacobs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081130172717.GA7047@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=david@statichacks.org \
--cc=felix@nibbo.se \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).