More Related Content
Similar to 今さら聞けない人のためのgit超入門 OSC2018京都 資料 (20)
More from VirtualTech Japan Inc./Begi.net Inc. (20)
今さら聞けない人のためのgit超入門 OSC2018京都 資料
- 2. 自己紹介
• 本名:宮原 徹
• 1972年1月 神奈川県生まれ
• 1994年3月 中央大学法学部法律学科卒業
• 1994年4月 日本オラクル株式会社入社
– PCサーバ向けRDBMS製品マーケティングに従事
– Linux版Oracle8の日本市場向け出荷に貢献
• 2000年3月 株式会社デジタルデザイン 東京支社長および株
式会社アクアリウムコンピューター 代表取締役社長に就任
– 2000年6月 (株)デジタルデザイン、ナスダック・ジャパン上場(4764)
• 2001年1月 株式会社びぎねっと 設立
• 2006年12月 日本仮想化技術株式会社 設立
• 2008年10月 IPA「日本OSS貢献者賞」受賞
• 2009年10月 日中韓OSSアワード 「特別貢献賞」受賞
• ガンダム勉強会主宰・好きなモビルスーツはアッガイ
2
- 4. 日本仮想化技術株式会社 概要
• 社名:日本仮想化技術株式会社
– 英語名:VirtualTech Japan Inc.
– 略称:日本仮想化技術/VTJ
• 設立:2006年12月
• 資本金:3,000万円
• 売上高:10,702万円(2017年7月期)
• 本社:東京都渋谷区渋谷1-8-1
• 取締役:宮原 徹(代表取締役社長兼CEO)
• 伊藤 宏通(取締役CTO)
• スタッフ:9名(うち、7名が仮想化技術専門エンジニアです)
• URL:http://VirtualTech.jp/
• 仮想化技術に関する研究および開発
– 仮想化技術に関する各種調査
– 仮想化技術を導入したシステムの構築・運用サポート
– OpenStackの導入支援・新規機能開発・運用サポート
– 自動化・DevOps支援
ベンダーニュートラルな
独立系仮想化技術の
エキスパート集団
4
- 17. Gitを利用したバージョン管理
A successful Git branching model
http://nvie.com/posts/a-successful-git-branching-model/
– リリース用と開発用の2つのメインブランチを
用意
– 機能追加、バグフィックス等Issue登録を行う毎
にメインブランチから切り出す
– 問題が起きても本番用ブランチや他の人の開
発には影響しない
– GitLabではマージリクエスト機能によりレ
ビューを可視化
17
- 21. GitLabインストール時の注意点
• 「Installation using the Omnibus packages」を
参考に環境を構築
– 普通にインストールページに行くとEEになってい
る
– https://about.gitlab.com/installation/#centos-7
• CEをインストールしたい場合は、上記ページ
の一番下の「CE or EE」をクリックし、さらに一
番下の「Install GitLab Community Edition」を
クリック
– https://about.gitlab.com/installation/#centos-
7?version=ce
21
- 22. CentOS 7.4へのインストール
1. sudo yum install -y curl policycoreutils-python
openssh-server
2. sudo systemctl enable sshd
3. sudo systemctl start sshd
4. sudo firewall-cmd --permanent --add-service=http
5. sudo systemctl reload firewalld
6. curl
https://packages.gitlab.com/install/repositories/gitl
ab/gitlab-ce/script.rpm.sh | sudo bash
7. yum install -y gitlab-ce
22
- 30. リポジトリにファイルを追加
1. 作業ディレクトリにファイルを追加
– $ touch README.md
2. ファイルをステージング
– $ git add README.md
3. ステージングしたファイルをコミット
– $ git commit
4. コミットしたファイルをリモートにプッシュ
– 同時にローカルリポジトリのアップストリーム設定
– $ git push --set-upstream origin master
• masterブランチのアップストリームをリモートリポジトリの
master(remotes/origin/master)に設定
30
- 31. リポジトリ操作実行例
$ touch README.md
$ git add README.md
$ git commit
[master f439952] touch test
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README.md
$ git push --set-upstream origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 248 bytes | 248.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To http://gitlab.example.com/tmiyahar/test.git
1285f2f..f439952 master -> master
Branch master set up to track remote branch master from origin.
31
- 34. ブランチを作成する
1. ブランチの確認
– $ git branch
– 現時点ではローカルのmasterだけ
2. ブランチの作成
– $ git branch develop
3. ブランチの切り替え(チェックアウト)
– $ git checkout develop
– $ git checkout –b develop で作成&移動も
4. ブランチの確認
– $ git branch
– 作業しているブランチがdevelopに変更されている
34
- 35. ブランチ作成実行例
$ git branch
* master
$ git branch develop
$ git checkout develop
Switched to branch 'develop'
develop branch
$ git branch
* develop
master
35
- 39. 超入門の次のステップは?
• 修正の重複(コンフリクト)の解消
– git push時に既にリモートが更新されている
– git pullするとコンフリクト発生
– 適切に修正し、再度コミット&プッシュ
39
developブランチで修正
<<<<<<< HEAD
ローカルのmasterブランチで修正
=======
Webブラウザで修正
>>>>>>> fcfafd335fd5d6a4bb8938c1c2dcbe17788debf5