備忘録
目標はローカルでも実行しつつ鯖にも置いておきたい。
前提条件
サーバ側(srv)
sudo apt-get install git-core
#ここから先は<鯖ユーザ>(git専用のユーザが好ましい?)
mkdir git
mkdir git/app
cd git/app
git init --bare --shared=true
git config --bool core.bare true
クライアントA側(clientA)
- gitレポジトリを作る
- こちら側でプロジェクトを開始するものとする。
sudo apt-get install git-core
mkdir git
mkdir git/app
cd git/app
git init
git add .
git commit
git remote add origin ssh://<鯖ユーザ>@<鯖アドレス>/home/<鯖ユーザ>/git/app
git push origin master
クライアントB側(clientB)
- gitレポジトリを作る
- こちら側でプロジェクトを取得するものとする。
sudo apt-get install git-core
mkdir git
mkdir git/app
cd git/app
git init
git add .
git commit
git remote add origin ssh://<鯖ユーザ>@<鯖アドレス>/home/<鯖ユーザ>/git/app
git pull origin master