$ git clone this/repo develop
$ git clone this/repo release
$ git clone --bare this/repo hosting
hosting repo
$ cd hosting
$ cp git-post-receive hooks/post-receive; chmod 755 hooks/post-receive
or
$ cp git-post-receive.py hooks/post-receive; chmod 755 hooks/post-receive
<check release repo path in 'post-receive' script!>
develop repo
$ cd ../develop
$ sed -i 's/remote "origin"/remote "gist"/' .git/config
$ git remote add origin ../bare
release repo
$ cd ../release
$ sed -i 's/remote "origin"/remote "gist"/' .git/config
$ git remote add origin ../bare
$ echo 1 >> a
$ git add a; git commit -m 'test 1'
$ git log
...
$ git push origin
$ ls -al ../release
../release/a
$ cat ../release/a
1
$ cd ../release
$ git log
... same as development us
make some changes in release tree.
$ cd ../release
$ echo exit 0 >> git-post-receive
push new changes from develop tree.
$ cd ../develop
$ echo 1 >> a
$ git add a; git commit -m 'test 1'
$ git push origin
$ git log
...
$ git fetch
$ git log
... (release changes are commited as a sole branch.)
after this example
.--.--.--.--.--.--. <- new commit in develop tree.
\
. <- release tree changes, tag: release_YMD_HMS
under construction.
- refer: git-hooks
- v1.1: the
git-post-receive
script looping in push.
- new files in release cannot be add automatically. (this is
commit -a
behavior)