Dears, 

Well, I tried and I'm trying new tests with Githook, Can I change owner 
directories and files for apache?
Because, I try add script with name post-merge on directory hooks, but when 
I execute command git pull, don't execute my scripts. Any idea? I look 
inumerals howtoo.

When I customize my hooks working, but the specific script post-merge 
doesn't work. I tried create a temporary file on /tmp/ directory and use 
command chown for change permitions of my Document Root.
I use Git pull to replicate my files of GLPI:

############################
cat .githooks/post-merge ( Detail: I use chmod +x on script)

#!/bin/bash

sudo chown apache:apache /var/www/html/glpi -R
sudo touch /tmp/file.txt
runuser -l root -c 'sudo chown apache:apache /var/www/html/glpi -R'
runuser -l root -c 'sudo touch /tmp/test'
sudo find /var/www/html/glpi -mount -user root -exec chown apache: -R {} \; 
2>/dev/null

############################
Mini tutorial:

mkdir .git/hooks
mkdir .githooks
git config core.hooksPath .githooks
find .git/hooks -type l -exec rm {} \;
find .githooks -type f -exec ln -sf ../../{} .git/hooks/ \;

ls
Erros-relatados.md files-upgrade glpi glpi.old README.md

My config: "git config --list"

user.email=x...@gmail.com
user.name=root
push.default=simple
pull.ff=no
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
You have new mail in /var/spool/mail/root
###########################
Git Client

[root@vm-dc-xxx2 test]# git init
Initialized empty Git repository in /var/www/html/.git/
[root@vm-dc-xxx2 test]# git pull --no-ff 
http://127.0.0.1:3000/root/xxxx-glpi.git
remote: Counting objects: 12834, done.
remote: Compressing objects: 100% (5278/5278), done.
remote: Total 12834 (delta 7205), reused 12829 (delta 7204)
Receiving objects: 100% (12834/12834), 587.29 MiB | 14.40 MiB/s, done.
Resolving deltas: 100% (7205/7205), done.

>From http://127.0.0.1:3000/root/xxxx-glpi
* branch HEAD -> FETCH_HEAD

[root@vm-dc-xxx2 test] ls -la
total 32
drwxr-xr-x. 7 root root 4096 Mar 29 15:23 .
drwxr-xr-x. 4 root root 33 Mar 13 16:03 ..
-rw-r--r--. 1 root root 2201 Mar 29 14:48 Erros-relatados.md
drwxr-xr-x. 4 root root 4096 Mar 29 14:48 files-upgrade
drwxr-xr-x. 8 root root 4096 Mar 29 15:19 .git
drwxr-xr-x. 2 root root 4096 Mar 29 15:12 .githooks
drwxr-xr-x. 18 root root 4096 Mar 29 14:49 glpi
drwxr-xr-x. 16 root root 4096 Mar 29 14:48 glpi.old
-rw-r--r--. 1 root root 1354 Mar 29 14:48 README.md

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