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
85
読んで理解するActiveRecordの設計とActiveSupport::Concern
totzyuta
4
1.5k
TDDとVimと
totzyuta
1
480
モテる!筋肉コンパイラ自作入門 - 草食男子からの卒業
totzyuta
0
420
Vimmer幼稚園
totzyuta
2
110
たのしいたーみなる
totzyuta
0
40
Other Decks in Programming
See All in Programming
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
Jakarta EE meets AI
ivargrimstad
0
210
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
300
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
Arm移行タイムアタック
qnighy
0
330
Featured
See All Featured
Site-Speed That Sticks
csswizardry
0
28
Building a Scalable Design System with Sketch
lauravandoore
459
33k
A designer walks into a library…
pauljervisheath
204
24k
Speed Design
sergeychernyshev
25
620
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Music & Morning Musume
bryan
46
6.2k
Teambox: Starting and Learning
jrom
133
8.8k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Facilitating Awesome Meetings
lara
50
6.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
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