GitのプッシュでHPの更新(反映)
    
    
      
        
  
        
      
    
  
gitのグローバル設定
1
2
3
  | git config --global user.name "abgata20000"
git config --global user.email "abgata@abgata.jp"
git config --global color.ui true
  | 
 
gitの設定確認
現在のディレクトリを共有リポジトリにする
1
  | git init --bare --share
  | 
 
レポジトリをクローンする
1
  | git clone /git/smaple.git
  | 
 
pushされた際のhooks(post-receive)
1
2
  | cd hooks
vim post-receive
  | 
 
post-receive
1
2
3
  | #!/bin/sh
cd /var/www/vhosts/
git --git-dir=.git pull origin master
  | 
 
実行権限を付与