SlideShare a Scribd company logo
1 of 45
Download to read offline
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

What's hot

Introducing Github and Octocats by Tony Bangratz
Introducing Github and Octocats by Tony BangratzIntroducing Github and Octocats by Tony Bangratz
Introducing Github and Octocats by Tony Bangratz
RailsGirls_RTM
 

What's hot (19)

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

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

Git Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfGit Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdf
uzair
 

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

Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.
 
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucketIntro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
 
AIS Technical Development Workshop 3: Getting Started with Git and GitHub
AIS Technical Development Workshop 3: Getting Started with Git and GitHubAIS Technical Development Workshop 3: Getting Started with Git and GitHub
AIS Technical Development Workshop 3: Getting Started with Git and GitHub
 
Github developing stack
Github developing stackGithub developing stack
Github developing stack
 
Github
GithubGithub
Github
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 Workshop
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git for Writers: Dumping the Bucket Metaphor
Git for Writers: Dumping the Bucket MetaphorGit for Writers: Dumping the Bucket Metaphor
Git for Writers: Dumping the Bucket Metaphor
 
Git with the flow
Git with the flowGit with the flow
Git with the flow
 
Beginner's guide to git
Beginner's guide to gitBeginner's guide to git
Beginner's guide to git
 
Git presentation
Git presentationGit presentation
Git presentation
 
Open Source_Git.pptx
Open Source_Git.pptxOpen Source_Git.pptx
Open Source_Git.pptx
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
Using github development process in your company
Using github development process in your companyUsing github development process in your company
Using github development process in your company
 
Formation git
Formation gitFormation git
Formation git
 
Git Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfGit Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdf
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

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