Gitハンズオンセミナー
導入編🐬
2021/05/09 13:00~14:30
overview
今回のセミナーの概要
● 目的:既存のGit書籍やセミナーがわかりにくいと感じたから
● ペルソナ:Gitを使用したことがない人
● セミナーの到達レベル:実務スタートでギリギリついていける?
● 方針:習うより慣れる
● PC環境:Windows or Mac (Linux環境では動作確認してません)
● 発表者経歴:機械学習エンジニア
● Twitter:https://twitter.com/Beluuuuuuga
3
既存の書籍・セミナー・映像授業の問題点
● 全てを説明しようとして初心者が消化不良になる🥲
○ Gitの説明
○ Gitの環境構築
○ GitのCLI操作
● Gitの理解・環境構築が難しいので操作方法の修得までたどり着かない🥲
○ モチベーション低下
● どのような時に何をしたらいいのかわからない🥲
○ Situation X -> Action X
○ どんなときに何をするのか説明がない
環境設定
Git/Githubの
操作
Gitの理解
CLI
GUI
4
今回のセミナー(2021/05/09)の特徴
● 全てを説明しようとして初心者が消化不良になる👌
○ Gitの説明
○ Gitの環境構築
○ GitのCLI操作
● Gitの理解・環境構築が難しいので操作方法の修得までたどり着かない👌
○ モチベーション低下
Git/Githubの
操作
GUI
5
次回のセミナー(2021/06/12)の特徴
● 全てを説明しようとして初心者が消化不良になる👌
○ Gitの説明
○ Gitの環境構築
○ GitのCLI操作
● Gitの理解・環境構築が難しいので操作方法の修得までたどり着かない👌
○ モチベーション低下
● どのような時に何をしたらいいのかわからない👌
○ Situation X -> Action X
○ どんなときに何をするのか説明がない
環境設定
Git/Githubの
操作
Gitの理解
CLI
GUI
6
git
Gitの紹介
● Gitとは、バージョン管理システム
● Gitのメリットの例
○ ”hoge_ver1.txt”や”hoge_ver2.txt”などファイル名による管理が必要ない
○ コードを編集しているときに前のバージョンに簡単に戻れる
○ 多人数での編集が可能
● Git関連のソフトウェア
○ リモートホスティングサービス
■ Github👈
■ Bitbucket
■ GitLab
○ GitのGUI
■ Github Desktop👈
■ Sourcetree
8
hands-on preparation
セミナーの準備
● 事前準備
○ Githubでアカウント作成👍
○ Github Desktopをインストール👍
10
セミナーの受け方
● セミナー内で登場する記号に注意!
○ Github上で作業
○ Github Desktop上で作業
○ エクスプローラー上で作業 (Windows)
○ ファインダー上で作業 (Mac)
● CLIのGitコマンドと紐づけて理解!
● 親しみのない横文字がたくさん登場するが気にしない!慣れてください!
11
🪟
🍎
🐱
🐱
hands-on step1~step7
Step1: Githubでリポジトリ作成 ; git init
● Tutorialというリポジトリを作成
13
🐱
Step2: Github Desktopでクローン ; git clone
● GithubアカウントをGithub Desktop連動させる
14
🐱 🪟
クリック
クリック
Step2: Github Desktopでクローン ; git clone
● Github上で作成したリポジトリをクローン
15
クリック
←Tutorialを選択
↓パスをメモ
クリック
🐱 🪟
Step2: Github Desktopでクローン ; git clone
16
リポジトリ名 ブランチ名
🐱 🪟
Step3: Github Desktopで差分登録 ; git add
● クローンしたリポジトリを確認
17
🐱 🪟
クリック
クリック
Step3: Github Desktopで差分登録 ; git add
● ファイル作成しGithub Desktopで差分を確認
18
🐱 🪟
クリック
クリック
git status
git diff
Step3: Github Desktopで差分登録 ; git commit
● 変更ファイルをコミット
19
クリック
クリック
mainブランチへコミット
コミットメッセージ;なるべく一言で言えるように
🐱 🪟
Step3: Github Desktopで差分登録 ; git push
● Githubへ差分を登録
20
クリック
クリック
mainブランチへコミット
mainブランチへコミット
クリック
🐱 🪟
Step4: Githubで差分を確認 
● Githubで変更ファイルを確認
21
🐱
バージョン管理
commit: create test file
=>testファイルの1行目
main
Step5: Github Desktopでブランチ作成 ; git branch
● 新ブランチを作成
23
クリック
クリック
クリック
新ブランチ名
git branch develop
git checkout develop
git checkout -b develop
=
🐱 🪟
Step5: Github Desktopでブランチ作成 ; git branch
● 新ブランチを確認
24
git branch
🐱 🪟
Step5: Github Desktopでブランチ作成 ; git commit
● 日付を追加
25
クリック
クリック
🐱 🪟
git add
git commit
=> vimでメッセージ
git add
git commit -m “<message>”
=> vimでメッセージいらない
=
バージョン管理
commit: create test file
=>testファイルの1行目
main
develop
commit: add date
=>testファイルの2行目
Step6: Githubでマージ ; git merge
● プルリクエスト:同僚・先輩などにレビューを行ってもらいマージされる
27
🐱 🪟
クリック
クリック
クリック
クリック
developからmainになっていることを確認
🐱
● マージ:技術が未熟な場合、実務で自らマージするケースは少ない
28
クリック
クリック
クリック
クリック
Step6: Githubでマージ ; git merge
🐱
バージョン管理
commit: create test file
=>testファイルの1行目
main
develop
merge: develop to main
=>developブランチをmainブランチにマージ
commit: add date
=>testファイルの2行目
● コンフリクト
○ 同じファイルの同じ行を編集し、リモートブランチに pushしたときに発生
○ 解消方法は手動でどちらの差分が合ってるのか選択する
○ Git初心者の第一の壁🙄
30
Step7: コンフリクト解消
バージョン管理
commit: create test file
=>testファイルの1行目
main
develop
merge: develop to main
=>developブランチをmainブランチにマージ
commit: add date
=>testファイルの2行目
commit: add place
=>testファイルの3行目
commit: add place
=>testファイルの3行目 conflict
merge
Step7: コンフリクト解消 ; git pull   
● mainブランチに切り替え、リモートリポジトリの差分を取り込む
32
クリック
git fetch
git merge
git pull
=
🐱 🪟
Step7: コンフリクト解消 ; git add, git commit, git push   
● mainブランチでtest.txtの3行目に書き込みコミットし、プッシュする
33
クリック
🐱 🪟
Step7: コンフリクト解消 ; git pull   
● developブランチに切り替え、リモートリポジトリの差分を取り込む
34
クリック
git fetch
git merge
git pull
=
🐱 🪟
Step7: コンフリクト解消 ; git add, git commit, git push      
● developブランチでtest.txtの3行目に書き込みコミットする
35
クリック
🐱 🪟
Step7: コンフリクト解消         
● developブランチからmainブランチにプルリクエスト
36
🐱 🪟
Step7: コンフリクト解消         
● developブランチからmainブランチの差分を確認
37
クリック
←develop
←main
🐱
Step7: コンフリクト解消         
● developブランチ差分を採用
38
手動でmainブランチの
差分を消す
クリック
クリック
🐱
Step7: コンフリクト解消         
● mainブランチに移動してfetchしてpull
39
クリック
クリック
developブランチの
差分がマージ
🐱 🪟
バージョン管理
commit: create test file
=>testファイルの1行目
main
develop
merge: develop to main
=>developブランチをmainブランチにマージ
commit: add date
=>testファイルの2行目
commit: add place
=>testファイルの3行目
merge: develop to main
=>developブランチをmainブランチにマージ
hands-on summary
まとめ
● Step1: Githubでリポジトリ作成
● Step2: Github Desktopでクローン
● Step3: Github Desktopで差分登録
● Step4: Githubで差分を確認
● Step5: Github Desktopでブランチ作成
● Step6: Githubでマージ
● Step7: コンフリクト解消
42
Gitコマンド
● 紹介したコマンド
○ git add, git commit, git commit -m <commit message>, git push,
○ git branch, git branch <branch name>, git checkout -b <branch name>,
○ git fetch, git pull, git merge
● 紹介してないコマンド
○ git commit --amend, git reset HEAD,
○ git branch -a,
○ git stash, git stash pop,
○ git log, git log --oneline,
○ git rebase, git merge squash,
○ などなど🙄
43
practice
練習問題
1. Gitコマンド確認;当てはまる
Gitコマンドを書く
a. 変更があったファイルを確認したいとき
b. 変更があったファイルの行を確認したいとき
c. どのブランチにいるのか確認したいとき
d. mainブランチにいて“feature”ブランチという新しいブランチを作成して移動したいとき
e. mainブランチにいてリモートリポジトリの差分を取り込みたいとき
2. 差分登録;以下手順を順に行う
a. developブランチに切り替える
b. featureブランチを作成
c. test.txtの4行目に”presented by beluga”と追記
d. GithubDesktopで差分を確認しコミットメッセージ”add organizer”と書いてコミット
e. featureブランチからdevelopブランチにプルリクエストしマージ
f. GithubDesktop上でGithubへpush
3. トラブルシューティング;以下の現象が起きたときどうするか考える
a. リモートリポジトリにpushできない
b. 上げてはいけないファイルをリモートリポジトリに pushしてしまった
c. 自分がレビュワーで数人のコードをレビューをしているが、レビューするスピードよりプルリクエストの方が溜まってしま
う状況になってしまった
45

More Related Content

PPTX
How to Git and Github | Hands on workshop
PPTX
Hacktoberfest 2020 - Open source for beginners
ODP
Development nightmares
PPTX
Free and open source sw
PPTX
Introduction to git and gitgub
PPTX
Ready, set, go! An introduction to the Go programming language
ODP
Vagrant and puppet: Deployment made easy
PDF
Semana 1 Git y Github
How to Git and Github | Hands on workshop
Hacktoberfest 2020 - Open source for beginners
Development nightmares
Free and open source sw
Introduction to git and gitgub
Ready, set, go! An introduction to the Go programming language
Vagrant and puppet: Deployment made easy
Semana 1 Git y Github

What's hot (19)

PDF
Introduction to Git (even for non-developers)
PDF
Introduction to Git (even for non-developers!)
PDF
Test-Driven Development with TypeScript+Jasmine+AngularJS
PPTX
Unit Testing TypeScript
PDF
ODP
Git: be social
PDF
Git intro fajar muslim
PPTX
Hello git - a soft introduction to git (Talk Slides)
PDF
GruntJS
PDF
Introduction to Google Web Toolkit - part 1
PDF
Grunt JS - Getting Started With Grunt
PDF
Vagrant & CFEngine - LOPSA East 2013
PDF
Gitting better
PDF
Grunt js and WordPress
PDF
Contributing to Open Source #Hacktoberfest
PDF
An Introduction to Git (even for non-developers)
PDF
Stop Sucking at Building Stuff!
PDF
Introducing Github and Octocats by Tony Bangratz
PPTX
Git step by step
Introduction to Git (even for non-developers)
Introduction to Git (even for non-developers!)
Test-Driven Development with TypeScript+Jasmine+AngularJS
Unit Testing TypeScript
Git: be social
Git intro fajar muslim
Hello git - a soft introduction to git (Talk Slides)
GruntJS
Introduction to Google Web Toolkit - part 1
Grunt JS - Getting Started With Grunt
Vagrant & CFEngine - LOPSA East 2013
Gitting better
Grunt js and WordPress
Contributing to Open Source #Hacktoberfest
An Introduction to Git (even for non-developers)
Stop Sucking at Building Stuff!
Introducing Github and Octocats by Tony Bangratz
Git step by step
Ad

Similar to 【初心者歓迎】Gitハンズオンセミナー 導入編 (20)

PPTX
Using Git with WordPress - Presented by Nigel Rodgers.
PDF
AIS Technical Development Workshop 3: Getting Started with Git and GitHub
PPTX
Github developing stack
PDF
PDF
Git Init (Introduction to Git)
PDF
BLUG 2012 Version Control for Notes Developers
PPTX
Git and GitHub workshop of GDG on Campus UNSTPB
PPTX
Git essential training & sharing self
PDF
Brief tutorial on Git
PDF
Git 101 Workshop
ODP
Introduction to Git
PDF
Git for Writers: Dumping the Bucket Metaphor
PDF
Git with the flow
PPTX
Beginner's guide to git
ODP
Git presentation
PPTX
Open Source_Git.pptx
PPT
git2.ppt
PPTX
Using github development process in your company
PDF
Formation git
Using Git with WordPress - Presented by Nigel Rodgers.
AIS Technical Development Workshop 3: Getting Started with Git and GitHub
Github developing stack
Git Init (Introduction to Git)
BLUG 2012 Version Control for Notes Developers
Git and GitHub workshop of GDG on Campus UNSTPB
Git essential training & sharing self
Brief tutorial on Git
Git 101 Workshop
Introduction to Git
Git for Writers: Dumping the Bucket Metaphor
Git with the flow
Beginner's guide to git
Git presentation
Open Source_Git.pptx
git2.ppt
Using github development process in your company
Formation git
Ad

Recently uploaded (20)

PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Five Habits of High-Impact Board Members
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPTX
The various Industrial Revolutions .pptx
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPT
Module 1.ppt Iot fundamentals and Architecture
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPTX
Modernising the Digital Integration Hub
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
Zenith AI: Advanced Artificial Intelligence
PPT
Geologic Time for studying geology for geologist
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Developing a website for English-speaking practice to English as a foreign la...
observCloud-Native Containerability and monitoring.pptx
sustainability-14-14877-v2.pddhzftheheeeee
Five Habits of High-Impact Board Members
NewMind AI Weekly Chronicles – August ’25 Week III
The various Industrial Revolutions .pptx
A novel scalable deep ensemble learning framework for big data classification...
Assigned Numbers - 2025 - Bluetooth® Document
Getting started with AI Agents and Multi-Agent Systems
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Module 1.ppt Iot fundamentals and Architecture
O2C Customer Invoices to Receipt V15A.pptx
Modernising the Digital Integration Hub
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Zenith AI: Advanced Artificial Intelligence
Geologic Time for studying geology for geologist
Hindi spoken digit analysis for native and non-native speakers
CloudStack 4.21: First Look Webinar slides
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Taming the Chaos: How to Turn Unstructured Data into Decisions
Developing a website for English-speaking practice to English as a foreign la...

【初心者歓迎】Gitハンズオンセミナー 導入編