LoginSignup
201

More than 5 years have passed since last update.

posted at

updated at

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

サーバ側作業

ユーザー作成

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

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
What you can do with signing up
201