I do execute the following steps to create on DEBIAN Server a
1) git bare repo; 
2) a working dir, where the files are copied after local git push;
3) a local clone on Windows, bare server repo is cloned.

I executed the following commands:

    # SERVER: Setup git bare repo on server on Debian Wheezy v7.8, GIT 2.3.6
    # mkdir /domains/site/test-workdir
    # make a content copy on DEBIAN server into a test workdir
    cp -rp /content/* /domains/site/test-workdir
    
    mkdir /domains/git/site-bare.git
    cd /domains/git/site-bare.git
    git --git-dir=. --work-tree=/domains/site/test-workdir/. init
    git config receive.denycurrentbranch ignore
    cd /domains/git/site-bare.git/hooks
    nano post-receive
    # add the following content until # end
    #!/bin/sh
    export GIT_WORK_TREE=/domains/site/test-workdir/.
    export GIT_DIR=/domains/git/site-bare.git/.git
    cd $GIT_WORK_TREE
    git checkout -f
    # end
    chmod +x post-receive
    cd ..
    git add .
    git commit -m "Initial commit"
    git status
    # On branch master
    # nothing to commit, working directory clean
    
    
    # LOCAL:
    cd /w/Dev/\!GIT/
    mkdir test-remote
    cd /w/Dev/\!GIT/test-remote
    git init
    git remote add web-local 
ssh://root@192.168.1.101/domains/git/site-bare.git
    git remote -v
    # web-local       ssh://root@192.168.1.101/domains/git/site-bare.git 
(fetch)
    # web-local       ssh://root@192.168.1.101/domains/git/site-bare.git 
(push)
    git pull web-local master
    
    
    # SERVER
    cd /domains/site/test-workdir/
    rm -r *
    
    # LOCAL (Windows7 64bit, git v2.3.6)
    # git push should execute post receive on remote, so workdir should get 
again the content
    git push web-remote master


Once I also got the 

    Counting objects: 27, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (27/27), done.
    Writing objects: 100% (27/27), 2.49 KiB | 0 bytes/s, done.
    Total 27 (delta 21), reused 0 (delta 0)
    remote: fatal: Not a git repository: '/domains/git/site-bare.git/.git'
    To ssh://root@192.168.1.101/domains/git/site-bare.git
    27b6ceb..8ed3301  master -> master


Later I did not get such "Not a git repository" error.
But anyway, the workdir is not filled with content, this is my problem.

UPDATE: If I do "git checkout -f" of the server, then the workdir is 
updated. So this means that the post-receive hook is not executed.

Any idea why the remote workdir is not updated?

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