参考にしたWebページはこちらです。
以下の手順は、このWebページを参考にして自分なりになぞっただけです。
[remote: ~] $ mkdir hello.git
[remote: ~/hello.git] $ cd hello.git
[remote: ~/hello.git] $ git init --bare
[remote: ~/hello.git] $ cd
[local: ~] mkdir hello
[local: ~] cd hello
[local: ~/hello] git init
[local: ~/hello] echo 'Hello' > index.html
[local: ~/hello] git add .
[local: ~/hello] git commit -m "Initial commit."
[local: ~/hello] git remote add origin ssh://USERNAME@MYSERVER:/home/USERNAME/hello.git
[local: ~/hello] git push origin master
[local: ~/hello] git remote -v
origin ssh://USERNAME@MYSERVER:/home/USERNAME/hello.git (fetch)
origin ssh://USERNAME@MYSERVER:/home/USERNAME/hello.git (push)
~/hello.hyuki.net/
を DocumentRoot
にする心づもり。[remote: ~] $ git clone ~/hello.git hello.hyuki.net
[remote: ~] $ cd hello.hyuki.net
[remote: ~/hello.hyuki.net] $ cat index.html
Hello
[local: ~/hello] vi index.html
[local: ~/hello] cat index.html
<!DOCTYPE html>
<h1>Hello</h1>
[local: ~/hello] git add .
[local: ~/hello] git commit -m "Add doctype."
[local: ~/hello] git push
[remote: ~/hello.hyuki.net] $ git pull
[remote: ~/hello.hyuki.net] $ cat index.html
<!DOCTYPE html>
<h1>Hello</h1>
post-receive
を準備[remote: ~/hello.hyuki.net] $ cd ~/hello.git/hooks
[remote: ~/hello.git/hooks] $ cp post-receive.sample post-receive
[remote: ~/hello.git/hooks] $ vi post-receive
[remote: ~/hello.git/hooks] $ cat post-receive
#!/bin/sh
cd /home/USERNAME/hello.hyuki.net/
git --git-dir=.git pull
[remote: ~/hello.git/hooks] $ cd
[local: ~/hello] vi index.html
[local: ~/hello] git add .
[local: ~/hello] git commit -m "Add body."
[local: ~/hello] git push
[remote: ~/hello.hyuki.net] $ cat index.html
<!DOCTYPE html>
...
<body>
<h1>Hello</h1>
</body>
</html>
[remote: ~] $ cd
~/hello.hyuki.net
が DocumentRoot
になるように[remote: ~/hello.hyuki.net] $ sudo vi /etc/httpd/conf/httpd.conf
[remote: ~/hello.hyuki.net] $ sudo /etc/rc.d/init.d/httpd restart
[local: ~/hello] vi index.html (編集やファイル追加)
[local: ~/hello] git add .
[local: ~/hello] git commit -m "今回の変更の説明"
[local: ~/hello] git push