Code Monkey home page Code Monkey logo

git-server-sample's Introduction

仮想環境

docker-compose

環境を立ち上げる(最初)

$ docker-comopse up -d

環境を落とす(最後)

$ docker-comopse down

環境に入る(server)

$ docker-comopse exec server /bin/bash

環境に入る(client1)

$ docker-comopse exec client-1 /bin/bash

環境に入る(client2)

$ docker-comopse exec client-2 /bin/bash

Server

INFO

  • hostname: server.test
  • ssh-port: 2222
  • user: user
  • password: password

SSH

Config

  • sshサーバーがport:2222でたっているため、ポートを指定しないといけない
  • configに記載しておくと楽
Host server.test
Hostname server.test
Port 2222

Client

  1. client1

    • hostname: client-1
    • user: client1
  2. client2

    • hostname: client-2
    • user: client2

Gitの簡易サーバー立て方

  1. このRepositoryをcloneしてくる
$ git clone https://github.com/kanorix/git-server-sample.git
  1. 移動して仮想環境を立ち上げる
$ cd git-server-sample/
$ docker-compose up -d
  1. Serverの環境にはいり、Gitをインストールする
$ docker-compose exec server /bin/bash
$ apk --update --no-cache add git
$ exit
  1. client-1の環境にはいり、project内で空のReposoitoryを作成
$ docker-compose exec client-1 /bin/bash
$ cd project
$ git init
$ git add hello.txt
$ git commit -m "version1"
  1. 作成したGitReposoitoryをサーバー側にアップロード
$ cd ..

$ ls
project
$ git clone --bare project project.git
Cloning into bare repository 'project.git'...

$ scp -r project.git [email protected]:/opt/
  1. remoteの情報を設定
$ git remote add origin [email protected]:/opt/project.git
  1. client-1の環境から抜ける
$ exit
  1. client-2の環境にはいり、cloneしてくる
$ docker-compose exec client-2 /bin/bash
$ git clone [email protected]:/opt/project.git
$ cd project

git-server-sample's People

Contributors

kanorix avatar zeke320 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.