Re: git for local web development

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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

> 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+w

I 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]