LoginSignup
192
202

More than 5 years have passed since last update.

Gitリモートリポジトリの作り方

Last updated at Posted at 2013-01-19

サーバ側作業

ユーザー作成

adduser gitrepo
usermod -a -G gitrepo nekogeruge

リポジトリ作成

su - gitrepo
mkdir testproject.git
cd testproject.git
git --bare init --shared

クライアント側作業

クライアント側で作成したプロジェクトをpushする

mkdir testproject
cd testproject
git init
echo "git test" > readme
git add .
git commit -m "first commit"
git remote add origin ssh://configのHostに記述した名前/home/gitrepo/testproject.git
git push origin master

cloneして変更を加えてpushしてみる

git clone ssh://configのHostに記述した名前/home/gitrepo/testproject.git
echo "oeeee" >> readme
git add .
git commit -m "change test"
git push origin master
git pull
cat readme
192
202
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
192
202