Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
198
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

Organization

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
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
198
Help us understand the problem. What are the problem?