LoginSignup
5
5

More than 5 years have passed since last update.

Gitで共有リポジトリを作成しつつ、サーバー上にpushごとに自動展開したいとき

Last updated at Posted at 2012-06-10

サーバー上にまず共有リポジトリを作成する。

mkdir Repo.git
cd Repo.git
git init --bare --shared=true

そして、
hooksフォルダ内のpost-receiveファイルを編集

(cd /home/admin/workspace/folder/;git --git-dir=.git pull;実行したいコマンド;)

サーバーのコピー先folderにて、

git clone Repo.git

ローカルマシンの、開発中のフォルダで

git init
git remote add origin ssh://admin@---/home/admin/workspace/---.git
git add .
git commit -m "initial import"
git push origin master
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5