Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Git/GitHub入門-GitHubでたのしいチーム開発
Search
Yuta Totz
August 24, 2015
Programming
0
290
Git/GitHub入門-GitHubでたのしいチーム開発
岡山大学テクノロジーラボ(OTL)のGitとGitHubについての入門ワークショップのときのスライドです。
Yuta Totz
August 24, 2015
Tweet
Share
More Decks by Yuta Totz
See All by Yuta Totz
ウガンダでXcodeをアップデートする方法
totzyuta
0
100
Working with UNIX Process 6/7 Chapter
totzyuta
1
60
珈琲と僕
totzyuta
0
83
読んで理解するActiveRecordの設計とActiveSupport::Concern
totzyuta
4
1.5k
TDDとVimと
totzyuta
1
470
モテる!筋肉コンパイラ自作入門 - 草食男子からの卒業
totzyuta
0
420
Vimmer幼稚園
totzyuta
2
110
たのしいたーみなる
totzyuta
0
40
Other Decks in Programming
See All in Programming
RailsのPull requestsのレビューの時に私が考えていること
yahonda
5
1.7k
生成 AI を活用した toitta 切片分類機能の裏側 / Inside toitta's AI-Based Factoid Clustering
pokutuna
0
570
Outline View in SwiftUI
1024jp
1
110
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.1k
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.1k
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
480
Piniaの現状と今後
waka292
5
1.4k
Go言語でターミナルフレンドリーなAIコマンド、afaを作った/fukuokago20_afa
monochromegane
2
140
From Subtype Polymorphism To Typeclass-based Ad hoc Polymorphism- An Example
philipschwarz
PRO
0
160
macOS でできる リアルタイム動画像処理
biacco42
6
1.7k
CSC509 Lecture 08
javiergs
PRO
0
100
Universal Linksの実装方法と陥りがちな罠
kaitokudou
1
220
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.9k
It's Worth the Effort
3n
183
27k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
RailsConf 2023
tenderlove
29
880
Designing the Hi-DPI Web
ddemaree
280
34k
Being A Developer After 40
akosma
86
590k
How to Think Like a Performance Engineer
csswizardry
19
1.1k
Designing for humans not robots
tammielis
249
25k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Transcript
Git/GitHub ೖ GitHubͰͨͷ͍͠νʔϜ։ൃ
ຊͷΰʔϧ
- Gitͨͷ͍͠ʂ - GitHubͰνʔϜ։ൃؾ͍࣋ͪʂ
git
git ͬͯͳΜΖ͔…
ࢄόʔδϣϯཧγεςϜ …Α͚͍Θ͔ΒΜ
ཁ͢Δͱ ࢄ ͯ͠ɺ όʔδϣϯ Λ ཧ͢Δ γεςϜ ͷ͜ͱ
ʮόʔδϣϯཧʯͬͯ…ʁ
ීஈͬͯΔ͜ͱ
ීஈͬͯΔ͜ͱ ϝϞ.txt ϝϞ ID: hoge
ϝϞ.txt ϝϞ ID: hoge ීஈͬͯΔ͜ͱ ϝϞ.txt ϝϞ ID: hoge2015 ฤूதʜ
ීஈͬͯΔ͜ͱ ϝϞ.txt ϝϞ ID: hoge ϝϞ.txt ϝϞ ID: hoge2015 ηʔϒʂʂ
ීஈͬͯΔ͜ͱ ϝϞ.txt ϝϞ ID: hoge ϝϞ.txt ϝϞ ID: hoge2015 ؒҧ͑ͯͨʂʂ
͍͚ͨ͠Ͳ্ॻ͖ͯ͠Μ͡ΌΜʂʂʂ
όʔδϣϯΛཧ͍ͨ͠ͱ͖ɺ Ͳ͏͠·͔͢ʁ …Α͚͍Θ͔ΒΜ
ίϐʔͯ͠όοΫΞοϓΛ ͱ͓ͬͯ͘ Ҋͦͷ̍
ίϐʔΛͱ͓ͬͯ͘ ࠷৽൛index.html index.html (લͷͭ) index-old.html index20510620.html ฤू༻index.html index.html
None
ʮόʔδϣϯཧʯͱ
ηʔϒ͢Δͨͼʹɺ όʔδϣϯΛৼΓ·͢
ʮόʔδϣϯཧʯͱ… ϝϞ.txt มߋ͠·ͨ͠ʂ ϝϞ.txt ηʔϒ͠·ͨ͠ʂ ver. 2 ver. 1
ʮόʔδϣϯཧʯͱ… ϝϞ.txt ϝϞ.txt ͍ؒҧ͑ͯͨʂ ্͔͠ॻ͖ͪ͠Όͬ ͨΑʔʂʂ ver. 2 ver. 1
ͦΜͳͱ͖ʹgitͳΒ ϝϞ.txt Ұݸલʹηʔϒͨ͠ ͱ͜Ζ(ver.1)ʹΔʂ ϝϞ.txt ͜ΕͰ҆৺ʂศརʂ ver. 2 ver. 1
ͯ͢ͷมߋཤྺΛཧͰ͖Δ gitͷ͍͍ͱ͜Ζͦͷ̍
gitͷ͜ͱ • ηʔϒ = ίϛοτ (commit) • ϦϙδτϦ = ϑΥϧμ
gitͷ͘͠Έ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT commit
merge ࣗͷ1$ͷத push fetch
ΈΜͳ͕ΈΜͳͷPCͰ ωοτͳͯ͘࡞ۀͰ͖Δ gitͷ͍͍ͱ͜Ζͦͷ̎
͜ΕͰgit͑Δʂ
$ git add FILENAME $ git commit -m “message” $
git push 1. εςʔδϯάɾΤϦΞʹՃ 2. ϩʔΧϧͰมߋΛηʔϒ 3. ϩʔΧϧͷηʔϒΛϦϞʔτʹηʔϒ
$ git add FILENAME $ git commit -m “message” 1.
εςʔδϯάɾΤϦΞʹՃ 2. ϩʔΧϧͰมߋΛηʔϒ
$ git add/commit ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT JOEFYIUNM
TUZMFDTT add/commit ࣗͷ1$ͷத
$ git add FILENAME $ git commit -m “message” $
git push 1. εςʔδϯάɾΤϦΞʹՃ 2. ϩʔΧϧͰมߋΛηʔϒ 3. ϩʔΧϧͷηʔϒΛϦϞʔτʹηʔϒ
$ git push 3. ϩʔΧϧͷηʔϒΛϦϞʔτʹηʔϒ
$ git push ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT JOEFYIUNM
TUZMFDTT ࣗͷ1$ͷத push
GitHubͱ
None
GitHubɺ GitͷϦϙδτϦ ΛϗεςΟϯά͢ΔαʔϏε
gitͷ͘͠Έ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT commit
merge ࣗͷ1$ͷத push fetch (JU)VC
None
νʔϜ։ൃͲ͏Μͷ
νʔϜ։ൃͷΓ͔ͨ τπΧͷϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ (GitHub͕ϗετ) JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT
commit merge fetch push
൴ঁͱڞಉ࡞ۀΛ͢Δͱ͖
൴ঁͱڞಉ࡞ۀΛ͢Δͱ͖ τπΧͷϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT commit merge
fetch push ൴ঁͷϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT commit merge fetch push ϦϞʔτϦϙδτϦ (GitHub͕ϗετ)
ϦϞʔτϦϙδτϦ (GitHub͕ϗετ) ൴ঁͱڞಉ࡞ۀΛ͢Δͱ͖ τπΧͷϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT
commit merge fetch push ൴ঁͷϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT commit merge fetch push ͜Ε͕ࢄʂʂʂ
νʔϜ։ൃϑϩʔ
νʔϜ։ൃϑϩʔ • ࣗͷΞΧϯτʹσʔλΛෳ (fork) • ϩʔΧϧ(ࣗͷPCͷத)ʹσʔλΛ࣋ͬͯ͘Δ (clone) • ฤू͢Δ •
มߋ༰Λίϛοτ(ηʔϒ)͢Δ (add/commit) • ίϛοτ༰ΛϦϞʔτ(GitHub্ͷιʔε)ʹө͢Δ (push) • Pull RequestΛͩ͢ (GitHubͷը໘͔Βʂ)
1. ෳ͢Δ (fork) ฤू͍ͨ͠σʔλͷෳΛࣗͷ GitHubͷΞΧϯτʹͭ͘Ε·͢ GitHubͷϖʔδ͔Βʂʂ
1. ෳ͢Δ (fork) ϩʔΧϧϦϙδτϦ ϦϞʔτϦϙδτϦ ࣗͷ1$ͷத (JU)VC ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT
ΦϦδφϧ
1. ෳ͢Δ (fork) ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ ࣗͷ1$ͷத fork (JU)VC
ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧ
$ git clone https://github… 2. ࣗͷPCʹ࣋ͬͯ͘Δ (clone) ϦϞʔτ(GitHub)͔Β ϩʔΧϧ(ࣗͷCP)ʹσʔλΛ͖࣋ͬͯ·͢ *
URLGitHubͷϖʔδ͔Βίϐϖ͠·͢
2. ࣗͷPCʹ࣋ͬͯ͘Δ (clone) ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ ࣗͷ1$ͷத (JU)VC ࣗͷΞΧϯτ
JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ
2. ࣗͷPCʹ࣋ͬͯ͘Δ (clone) ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT ࣗͷ1$ͷத
clone (JU)VC ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ JOEFYIUNM TUZMFDTT
3. ฤू͢Δ
3. ฤू͢Δ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT ࣗͷ1$ͷத (JU)VC
ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ JOEFYIUNM TUZMFDTT
3. ฤू͢Δ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT ࣗͷ1$ͷத (JU)VC
ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ JOEFYIUNM TUZMFDTT ฤूͨͬͨ͠ʂʂʂʂ
$ git commit -m “message” 4. ίϛοτ(ηʔϒ)͢Δ ϩʔΧϧʢࣗͷPCͷதʣͰ มߋ༰Ληʔϒʂ $
git add FILENAME commit(ηʔϒ)͢ΔϑΝΠϧΛબͿ
4. ίϛοτ(ηʔϒ)͢Δ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT ࣗͷ1$ͷத (JU)VC
ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ JOEFYIUNM TUZMFDTT
4. ίϛοτ(ηʔϒ)͢Δ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT add /
commit ࣗͷ1$ͷத (JU)VC ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ JOEFYIUNM TUZMFDTT
$ git push 5. ϦϞʔτʹө͢Δ (push) ϩʔΧϧʢࣗͷPCʣͷதͷมߋΛ ϦϞʔτʢGitHub্ʣͷιʔεʹө͠·͢
5. ϦϞʔτʹө͢Δʢpushʣ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT ࣗͷ1$ͷத (JU)VC
ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ JOEFYIUNM TUZMFDTT
5. ϦϞʔτʹө͢Δʢpushʣ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT ࣗͷ1$ͷத (JU)VC
ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ JOEFYIUNM TUZMFDTT push
GitHubͷϖʔδ͔Βʂʂ 6. มߋΛऔΓࠐΜͰΒ͏ ʢpull requestʣ ΦϦδφϧͷϨϙδτϦʹ ʮͷมߋΛऔΓࠐΜͰ͘Εʂʯ ͱϦΫΤετ͠·͢
5. มߋΛऔΓࠐΜͰΒ͏ʢpull requestʣ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT ࣗͷ1$ͷத
(JU)VC ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ JOEFYIUNM TUZMFDTT
5. ϦϞʔτʹө͢Δʢpushʣ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT ࣗͷ1$ͷத (JU)VC
ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ JOEFYIUNM TUZMFDTT PR มߋ͔ͨ͠Βऔ ΓࠐΜͰΑʔʂʂ
5. ϦϞʔτʹө͢Δʢpushʣ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT ࣗͷ1$ͷத (JU)VC
ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ JOEFYIUNM TUZMFDTT PR มߋ͔ͨ͠Βऔ ΓࠐΜͰΑʔʂʂ 0,
0. ΈΜͳͷมߋΛऔΓࠐΉ $ git pull upstream master ΦϦδφϧͷํͷϦϞʔτʢGitHub্ʣ͕มߋ͞Ε ͍ͯͨΒ࠷৽൛ΛࣗͷιʔεʹऔΓࠐΉ $
git remote add upstream https:// github.com/okadai-techlab/okayama-u- techlab.com.git ͯ͘Β΅ͷΦϦδφϧͷํϦϞʔτઌͱͯ͠ొ͢Δ * ొ࠷ॳͷҰճ͚ͩͰ͍͍Αʂ ‘upstrem’໊ͬͯલ͡Όͳ͍͍ͯ͘Αʂ
5. มߋΛऔΓࠐΜͰΒ͏ʢpull requestʣ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT ࣗͷ1$ͷத
(JU)VC ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT ΦϦδφϧʢຊମʣ upstream JOEFYIUNM TUZMFDTT ୭͔͕มߋͨ͠ ʢ࠷৽൛ʣ ෳ origin
5. มߋΛऔΓࠐΜͰΒ͏ʢpull requestʣ ϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT ϦϞʔτϦϙδτϦ JOEFYIUNM TUZMFDTT ࣗͷ1$ͷத
(JU)VC ࣗͷΞΧϯτ JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT pull ΦϦδφϧʢຊମʣ upstream ෳ origin
൴ঁͱڞಉ࡞ۀΛ͢Δͱ͖ τπΧͷϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT commit merge
push ൴ঁͷϩʔΧϧϦϙδτϦ JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT commit merge pull push ϦϞʔτϦϙδτϦ (GitHub͕ϗετ) upstream JOEFYIUNM TUZMFDTT JOEFYIUNM TUZMFDTT push pull push PR PR ෳ origin
νʔϜ։ൃϑϩʔ • ࣗͷΞΧϯτʹσʔλΛෳ (fork) … 1ճ͚ͩ • ϩʔΧϧ(ࣗͷPCͷத)ʹσʔλΛ࣋ͬͯ͘Δ (clone) …
1ճ͚ͩ • ࠷৽൛ΛऔΓࠐΉ (pull) • ฤू͢Δ • มߋ༰Λίϛοτ(ηʔϒ)͢Δ (add/commit) • ίϛοτ༰ΛϦϞʔτ(GitHub্ͷιʔεorigin)ʹө͢Δ (push) • ΈΜͳͷมߋΛऔΓࠐΉ (Pull RequestΛͩ͢) -> pullʹΔ
Demo