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 git    git    4096 24. Jul 13:34 .
drwxrwxrwx  4 apache apache 4096 24. Jul 13:34 ..
drwxrwxr-x  2 git    git    4096 24. Jul 13:34 branches
-rw-rw-r--  1 git    git      66 24. Jul 13:34 config
-rw-rw-r--  1 git    git      73 24. Jul 13:34 description
-rw-rw-r--  1 git    git      23 24. Jul 13:34 HEAD
drwxrwxr-x  2 git    git    4096 26. Jul 14:18 hooks
drwxrwxr-x  2 git    git    4096 24. Jul 13:34 info
drwxrwxr-x 16 git    git    4096 26. Jul 14:19 objects
drwxrwxr-x  4 git    git    4096 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.


Reply via email to