LoginSignup
0

More than 5 years have passed since last update.

ssh越しのリポジトリにpush、hookスクリプト

Last updated at Posted at 2013-07-29
  • serverにてリポジトリ作成
(server)$ mkdir myrepo.git
(server)$ cd myrepo.git
(server)$ git init --bare
  • clientにてリポジトリアクセス
(client)$ git clone ssh://username@server

いろいろ修正、コミットする

(client)$ git push origin master:master

これでserverにclientがpushできる。

post-update

git pushしたら自動でpullしてもらう仕組み。

server:myrepo.git/hooks/post-update
#!/bin/sh

set -eu
cd /srv/wikitten/library/
git --git-dir=.git pull

--git-dir=.gitを付けないと動作しなかった。

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
0