Re: [git-users] post-commit not run after git push

2013-07-26 Thread Andreas Dvorak
thank you,
post-receive is executed after the push
 
Best regards,
Andreas
 

Am Freitag, 26. Juli 2013 15:09:38 UTC+2 schrieb Konstantin Khomoutov:

> On Fri, 26 Jul 2013 05:43:34 -0700 (PDT) 
> Andreas Dvorak > wrote: 
>
> > I have a central git bare repository and would like to run a 
> > post-commit after the git push on a local repository on an other 
> > server. But the post-commit does nothing or is not executed. 
> [...] 
>
> I suspect you're confusing committing and pushing -- committing happens 
> when you run `git commit`, and committing does not result in any 
> network transfer -- only the local repository is updated. 
>
> Then you might push the updated history to another repository, and for 
> that repository, this act is called "reception" (of new objects), which 
> might then result in "updating" (of refs, such as branches and tags), 
> and so pre-receive, post-receive, update and post-update hooks are run, 
> if present. Consult the githooks(5) manual for details. 
>

-- 
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/groups/opt_out.




Re: [git-users] post-commit not run after git push

2013-07-26 Thread Konstantin Khomoutov
On Fri, 26 Jul 2013 05:43:34 -0700 (PDT)
Andreas Dvorak  wrote:

> I have a central git bare repository and would like to run a
> post-commit after the git push on a local repository on an other
> server. But the post-commit does nothing or is not executed.
[...]

I suspect you're confusing committing and pushing -- committing happens
when you run `git commit`, and committing does not result in any
network transfer -- only the local repository is updated.

Then you might push the updated history to another repository, and for
that repository, this act is called "reception" (of new objects), which
might then result in "updating" (of refs, such as branches and tags),
and so pre-receive, post-receive, update and post-update hooks are run,
if present. Consult the githooks(5) manual for details.

-- 
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/groups/opt_out.




[git-users] post-commit not run after git push

2013-07-26 Thread Andreas Dvorak
Dear all,
 
I have a central git bare repository and would like to run a post-commit 
after the git push on a local repository on an other server.
But the post-commit does nothing or is not executed.
 
The central git repository
/data/git/test2.git with
drwxrwxr-x  7 gitgit4096 24. Jul 13:34 .
drwxrwxrwx  4 apache apache 4096 24. Jul 13:34 ..
drwxrwxr-x  2 gitgit4096 24. Jul 13:34 branches
-rw-rw-r--  1 gitgit  66 24. Jul 13:34 config
-rw-rw-r--  1 gitgit  73 24. Jul 13:34 description
-rw-rw-r--  1 gitgit  23 24. Jul 13:34 HEAD
drwxrwxr-x  2 gitgit4096 26. Jul 14:18 hooks
drwxrwxr-x  2 gitgit4096 24. Jul 13:34 info
drwxrwxr-x 16 gitgit4096 26. Jul 14:19 objects
drwxrwxr-x  4 gitgit4096 24. Jul 13:34 refs
ls -l hooks/
total 44
-rwxrwxr-x 1 git git  452 24. Jul 13:34 applypatch-msg.sample
-rwxrwxr-x 1 git git  896 24. Jul 13:34 commit-msg.sample
-rwxrwxr-x 1 git git  284 26. Jul 14:18 post-commit
-rwxrwxr-x 1 git git  548 24. Jul 13:34 post-receive.sample
-rwxrwxr-x 1 git git  189 24. Jul 13:34 post-update.sample
-rwxrwxr-x 1 git git  398 24. Jul 13:34 pre-applypatch.sample
-rwxrwxr-x 1 git git 1578 24. Jul 13:34 pre-commit.sample
-rwxrwxr-x 1 git git 1239 24. Jul 13:34 prepare-commit-msg.sample
-rwxrwxr-x 1 git git 4951 24. Jul 13:34 pre-rebase.sample
-rwxrwxr-x 1 git git 3611 24. Jul 13:34 update.sample
 
cat hooks/post-commit 
#!/bin/sh
#
# An example hook script that is called after a successful
# commit is made.
#
# To enable this hook, rename this file to "post-commit".
touch /var/tmp/post-commit
unset GIT_INDEX_FILE
export GIT_WORK_TREE=/var/tmp/git
export GIT_DIR=/data/git/test2.git
git checkout -f
the local git repository
git/test2
 
git remote show origin
Enter passphrase for key '/home/user1/.ssh/id_rsa': 
* remote origin
  Fetch URL: git@rh6-puppet-master:/data/git/test2.git
  Push  URL: git@rh6-puppet-master:/data/git/test2.git
  HEAD branch: master
  Remote branch:
master tracked
  Local ref configured for 'git push':
master pushes to master (up to date)
Can somebody please help to execute the post-commit?
 
Best regards
Andreas

-- 
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/groups/opt_out.