On Sat, 17 Dec 2016 16:27:25 -0800 (PST)
tombert <tombert.gr...@live.at> wrote:

> Inside the server pre-receive hook I configure a new remote and push
> to it. Similar to this:
> 
> *git remote add test http://something.something/repo*
> *git push --mirror test*
> 
> From the bash command line all works, but when executed inside the
> hook I get:
> *Unable to create <file.lock>: Permission denied*
[...]

You don't need to configure a remote to push stuff: remotes are sort of
monikers to a) not spell unwieldy URLs each time; b) have other options
configured on per-remote basis; c) have those monikers used to
"namespace" branches fetched from the respective remotes.

Hence, does it work for you when you just do

  git push --mirror http://something.something/repo

?

On the other hand, the error message appears to be strange: Git wouldn't
tell you "Permission denied" when it would tell you "(something) is now
locked": your operation would either wait on the lock until it's removed
or fail with a message "...blah blah locked" or something like this.

Hence I sense a problem might be orthogonal to Git.
Two shots in the dark:
* Aren't you using something like `su` in your mirroring logic which
  would change the credentials of the process from those Git is running
  with?
* Can you verify where that "file.lock" is attempted to be created?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to