git push does not update remote workdir -


i execute following steps create on debian server 1) git bare repo; 2) working dir, files copied after local git push; 3) local clone on windows, bare server repo cloned.

i executed following commands:

# server: setup git bare repo on server on debian wheezy v7.8, git 2.3.6 # mkdir /domains/site/test-workdir # make content copy on debian server 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 following content until # end #!/bin/sh export git_work_tree=/domains/site/test-workdir/ export git_dir=/domains/git/site-bare.git/ cd $git_dir git checkout -f # end chmod +x post-receive cd .. git add . git commit -m "initial commit" git status # on branch master # nothing 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, workdir should again content git push web-remote master 

once got

counting objects: 27, done. delta compression using 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 git repository: '/domains/git/site-bare.git/.git' ssh://root@192.168.1.101/domains/git/site-bare.git 27b6ceb..8ed3301  master -> master 

later did not such "not git repository" error. anyway, workdir not filled content, problem.

update: if "git checkout -f" of server, workdir updated, means post-receive hook not executed.

update2: fixed bug in post-receive, still not updated. if execute post-receive script manually.

any idea why remote workdir not updated?

first, you're trying manually tools capistrano meant for, should have @ it.

i think problem ran "git init" without --bare. if want bare repo, use --bare, , won't need "git config receive.denycurrentbranch ignore".

you should see related question: how copy pushed branch directory?


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -