gitosis
中央リポジトリのプッシュ後フックを作成しています
中央リポジトリからテスト環境に更新をプルします
nano /var/git/repositories/holding.git/hooks/post-update
#!/bin/bash
cd /var/vh/holding;
git reset --hard;
git checkout testing;
git pull;
ここで、クライアント(開発用 VM)にプッシュした後に得られるもの
# blah ...
Counting objects: 57, done.
Compressing objects: 100% (24/24), done.
Writing objects: 100% (30/30), 3.42 KiB, done.
Total 30 (delta 18), reused 0 (delta 0)
fatal: Not a git repository: '.'
fatal: Not a git repository: '.'
fatal: Not a git repository: '.'
fatal: Not a git repository: '.'
To git@cheby.ru:holding.git
233b5a2..0f46cd8 testing -> testing
明らかに、プルする場所を git に伝えようとした私の試みは失敗しました。
What is correct way to run git command for a specified working copy in bash script?