Re: git for local web development
- From
Jeff King <peff@peff.net>
- Date
- Apr 17, 2009, 18:30 UTC
- Message-ID
- <20090417183046.GB30240@coredump.intra.peff.net>
- In-Reply-To
- <loom.20090417T153819-898@post.gmane.org>
On Fri, Apr 17, 2009 at 03:44:43PM +0000, William DiNoia wrote:
> I have since switched to using the post-update hook which now looks like: > > git-checkout -f > exec git-update-server-info
That will ignore any error code from git-checkout; you probably want
git checkout -f && git update-server-info
Show 10 quoted lines
> However upon git-push from /home/william/Desktop I receive the following: > > Counting objects: 5, done. > Compressing objects: 100% (2/2), done. > Writing objects: 100% (3/3), 281 bytes, done. > Total 3 (delta 1), reused 0 (delta 0) > Unpacking objects: 100% (3/3), done. > To /var/www/sites/test.com/.git > e337c9b..581228f master -> master > error: unable to unlink old 'index.html' (Permission denied)
So this is the same error as before, because it is coming from the "git-checkout -f" invocation.
Show 6 quoted lines
> The repo is owned by "www-data" and I am pushing as user "william". "william" > is in the "www-data" group. I also ran > > git-config core.sharedrepository group > > as "www-data", but no change...
The error is in the permissions of the working tree that already exists. core.sharedrepository is about the settings that git uses for files within $GIT_DIR. The working tree files that already exist are not changed.
I suspect if you "ls -ld /var/www/sites/test.com" you will see that it does not have group write permissions. If that is the case, it is probably simplest to just add group write permissions to the whole tree:
find /var/www/sites/test.com -name .git -prune -o -print0 |
xargs -0 chmod g+wI don't recall offhand whether newly created files in the working tree will have the group and permissions set according to core.sharedrepository (I think sharedrepository is usually about users sharing a common repo for pushing into).
If you are just going to push as "william", is there a reason that the repo and working tree are not owned by "william"? As long as www-data, presumably the webserver could still serve it.
-Peff