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 Workshop 02
Search
Li-Hsuan Chen
September 29, 2016
Programming
0
95
Git Workshop 02
Li-Hsuan Chen
September 29, 2016
Tweet
Share
More Decks by Li-Hsuan Chen
See All by Li-Hsuan Chen
The UX thinking of PAY ID
vc7
2
420
From Onboarding to Value Delivering in iOS
vc7
0
240
Merciless Refactoring
vc7
0
700
Protocol 的實例、測試和心得
vc7
2
760
共有経済
vc7
0
160
.gitignore
vc7
1
78
Git Workshop 03
vc7
0
110
Escaping Closures in Swift - 公司內分享會
vc7
1
220
Git Workshop 01
vc7
0
160
Other Decks in Programming
See All in Programming
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
360
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
150
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
970
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
650
Haze - Real time background blurring
chrisbanes
1
520
良いユニットテストを書こう
mototakatsu
8
3.1k
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
300
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
MCP with Cloudflare Workers
yusukebe
2
230
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
180
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
110
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Optimizing for Happiness
mojombo
376
70k
Rails Girls Zürich Keynote
gr2m
94
13k
Visualization
eitanlees
146
15k
How to Ace a Technical Interview
jacobian
276
23k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
A Philosophy of Restraint
colly
203
16k
Designing for humans not robots
tammielis
250
25k
Scaling GitHub
holman
459
140k
Designing for Performance
lara
604
68k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Transcript
(JU8PSLTIPQ 痧✳㔐 ꤫愴蠩
㥶卓⡹殹♴聃♶䥢 〳⟃꼛♳䩧倬䧮
㣐笧 ˖ 㔐瘸♧妄㉏⽷涸㉏겗 ˖ ⴕ佅㻜⡲ ˖ 倞㟞莅ざ⢘ⴕ佅 ˖ 贖椚遼瑳 ˖
ⴕ佅涸溫湡
㔐瘸㉏겗
䙦랃嫲鯱晝劥涸䊴殯
䙦랃嫲鯱晝劥涸䊴殯 ˖ (JU剤鸏⦐䭸⟂〳⟃麨䧭 ˖ ♶麕涮䊨Ⱘ鸒䌢鿪〳⟃䍲⡹刿㺂僒麨䧭 ˖ 4PVSDF5SFF ˖ 9DPEF ˖
˘瘞瘞 $ git diff [commit-1-id] [commit-2-id]
笞麌莅涮ず儘鹎遤儘 㥶⡦鋊ⷔⴕ佅
笞麌莅涮ず儘鹎遤儘 㥶⡦鋊ⷔⴕ佅 ˖ HJUPX剤㛇燊涸崩玑〳⟃黾䗅 ˖ ꆚ㼩笞麌㢵♧佅笞麌欽涸⚺ⴕ佅 ˖ ♶銴雊笞麌ㄤ涮欽ⴕ佅涸Ⰹ㺂湱䊴㣖㢵 git-flow
ざ⢘焥ⵌ遼瑳 鑪㥶⡦贖椚
㼠갤佞崞⹛涸须俲
醳绢♧♴
(JU涸♲⦐ꥣ媯 8PSLJOH%JSFDUPSZ 䊨⡲湡ꏗ 4UBHF *OEFY 程䒸⼦ -PDBM3FQPTJUPSZ 劥㖒⮭㶸䏨 劢鄄鷆髠涸墂呪
佞㖈TUBHF涸墂呪隶刿 䩞〳⟃鄄⸈Ⰵ晝劥䱾ⵖ 鄄晝劥䱾ⵖ涸墂呪
(JU涸♲⦐ꥣ媯 8PSLJOH%JSFDUPSZ 䊨⡲湡ꏗ 4UBHF *OEFY 程䒸⼦ -PDBM3FQPTJUPSZ 劥㖒⮭㶸䏨 劢鄄鷆髠涸墂呪
佞㖈TUBHF涸墂呪隶刿 䩞〳⟃鄄⸈Ⰵ晝劥䱾ⵖ 鄄晝劥䱾ⵖ涸墂呪 $ git init
(JU涸♲⦐ꥣ媯 8PSLJOH%JSFDUPSZ 䊨⡲湡ꏗ 4UBHF *OEFY 程䒸⼦ -PDBM3FQPTJUPSZ 劥㖒⮭㶸䏨 劢鄄鷆髠涸墂呪
佞㖈TUBHF涸墂呪隶刿 䩞〳⟃鄄⸈Ⰵ晝劥䱾ⵖ 鄄晝劥䱾ⵖ涸墂呪 $ touch a.txt
(JU涸♲⦐ꥣ媯 8PSLJOH%JSFDUPSZ 䊨⡲湡ꏗ 4UBHF *OEFY 程䒸⼦ -PDBM3FQPTJUPSZ 劥㖒⮭㶸䏨 劢鄄鷆髠涸墂呪
佞㖈TUBHF涸墂呪隶刿 䩞〳⟃鄄⸈Ⰵ晝劥䱾ⵖ 鄄晝劥䱾ⵖ涸墂呪 $ git add a.txt
(JU涸♲⦐ꥣ媯 8PSLJOH%JSFDUPSZ 䊨⡲湡ꏗ 4UBHF *OEFY 程䒸⼦ -PDBM3FQPTJUPSZ 劥㖒⮭㶸䏨 劢鄄鷆髠涸墂呪
佞㖈TUBHF涸墂呪隶刿 䩞〳⟃鄄⸈Ⰵ晝劥䱾ⵖ 鄄晝劥䱾ⵖ涸墂呪 $ git commit -m “add a.txt”
鹎Ⰵ姻겗
#SBODI
捀➊랃銴欽#SBODI ˖ ꥬꨆ䊨⡲橇㞯㥶 ˖ 㢵➃⼿⡲ ˖ ♶ずꥣ媯涮⡑TUBHJOH QSPEVDUJPO ˖ ⸆腋鑑⨞
倞㟞CSBODI⚛DPNNJU $ cd /to/your/path $ git init $ touch a.txt
$ git add a.txt $ git commit -m “add a.txt” $ git branch my-branch $ git checkout my-branch $ touch b.txt $ git add b.txt $ git commit -m “add b.txt” ⯓⹛䩛⨞⨞溏 㖈麕玑⚥欽4PVSDF5SFF溏溏䧭卓
倞㟞CSBODI ˖ branch倞㟞ⴕ佅涸䭸⟂ ˖ my-branchⴕ佅涸そ珖〳⟃荈㹁纏 $ git branch my-branch
ⴗ䳖䊨⡲ⴕ佅 ˖ checkoutⴗ䳖䊨⡲䨾㖈⡙縨涸䭸⟂ ˖ my-branch銴䖃涸⡙縨㖈鸏酭僽➿邍銴 䖃涸CSBODI $ git checkout my-branch
鑑衽䪪䪪溏HJU鼩〳⟃DIFDLPVU➊랃匌銯
ざ⢘㻨岁 $ git branch my-branch $ git checkout my-branch 㥶卓⡹濼麥鸏⦐CSBODI僽倞涸
〳⟃鸏垺㻨 $ git checkout -b my-branch
倞㟞CSBODI⚛DPNNJU $ cd /to/your/path $ git init $ touch a.txt
$ git add a.txt $ git commit -m “add a.txt” $ git checkout -b my-branch $ touch b.txt $ git add b.txt $ git commit -m “add b.txt”
ざ⢘CSBODI … (前略略) $ git checkout master $ git merge
my-branch ⯓⹛䩛⨞⨞溏 㖈麕玑⚥欽4PVSDF5SFF溏溏䧭卓
剤尝剤涮欰✫➊랃✲
CSBODI♶鋅✫
ⴗ䳖䊨⡲ⴕ佅 ˖ checkoutⴗ䳖䊨⡲䨾㖈⡙縨涸䭸⟂ ˖ master銴䖃涸⡙縨㖈鸏酭僽➿邍銴䖃涸 CSBODI⛳㽠僽갸鏤涸⚺銴ⴕ佅 $ git checkout master
䘰鱲 ˖ (JU㖈ざ⢘ⴕ佅儘剚㖈䗳銴䞕䕎♴鍸涮䘰鱲堥 ⵖ fast forward Updating 464aead..0169033 Fast-forward 鸏Ⰽ⦐*%㣐㹻剚♶♧垺
䘰鱲 ˖ (JU㖈ざ⢘ⴕ佅儘剚㖈䗳銴䞕䕎♴鍸涮䘰鱲堥 ⵖ ˖ 殹㥠錏䖤〫銴獵⹛CSBODI涸剓畮⽰〳㽠剚湬 䱺獵⹛♶剚倞㟞♧⦐NFSHF涸DPNNJU ˖ 〫銴鄄ざ⢘鹎涸CSBODI㖈ⴕ佅ⴀ植䖕剤倞涸 DPNNJU㽠♶剚鄄䘰鱲
fast forward
鼚⯝䘰鱲 $ git merge --no-ff my-branch
鑬稣➝稲俒畎〳鋅IUUQCJUMZHXOP
鑬稣➝稲俒畎〳鋅IUUQCJUMZHXOP
鑬稣➝稲俒畎〳鋅IUUQCJUMZHXOP
鑬稣➝稲俒畎〳鋅IUUQCJUMZHXOP
遼瑳 $POJDU
殹剤Ⰽ⦐ⴕ佅 ず儘⥜佖♧⦐墂呪
㽠剤〳腋涮欰遼瑳 殹NFSHF涸麕玑⚥剤遼瑳涮欰儘㽠剚⚥倬NFSHF
遼瑳涸垦爚 ˖ 錚㻌墂呪剤ㆭ❉隶⻋ ˖ 对㹁銴殆ㆭ⦐鿈ⴕ⚛䗳갭銴䪾鸏❉垦爚獵ꤑ ˖ ꬒ竤뀿 <<<<< ===== >>>>>
遼瑳鍑对㸤䧭䖕 ˖ 鍑对㸤䧭儘䗳갭DPNNJU • git add . // ઌ㑚Ճೖ stage
• git commit // ࣥߦ commit ˖ 岤䠑搂岁鍑对儘䗳갭銴鷎ⴀNFSHF垸䒭 • git merge --abort ˖ 岤䠑剤㼠呪墂䚍颶涸㼠呪䗳갭銴增叆僽や〳管陼麕ㄤ齅鱀姻焷䩞 腋鹎遤NFSHFDPNNJU <<<<< ===== >>>>>
ⴕ佅涸溫湡
ⴕ佅♶僽♧哭箁 劥颶⢵铞
ⴕ佅僽➊랃 ˖ HEAD湡䨾㖈涸⡙縨 ˖ ➮㶸衽䭸ぢ涸⡙縨〳⟃僽DPNNJU〳⟃僽♧⦐ CSBODI涸墂呪⡙縨 ˖ #SBODI〫僽♧⦐㶸剤DPNNJUJE涸墂呪 ˖ ⴕ佅僽겳⡂䭸垦涸嚌䙂
˖ 鮿넓剤鳵岁殥箁ⴀ⢵僽㔔捀➮⦛䭸ⵌ涸DPNNJU剤 QBSFOUDPNNJU
cf1dcd… master cf1dcd… NBTUFS )&"% ref: refs/heads/master HEAD
〳⟃⨞➊랃✲ 㼭䗱捀♳
湡捀姺涸䭸⟂ • git init • git add <filename> • git
commit -m “message” • git branch <branch name> • git checkout <branch name> • git checkout -b <branch name> • git merge <branch name> • git merge --no-ff <branch name> • git merge --abort • git diff <commit id 1> <commit id 2>
籏穡 ˖ 捀➊랃銴欽ⴕ佅 ˖ 㥶⡦䒊用ⴕ佅ㄤざ⢘ⴕ佅 ˖ ➊랃僽捀➊랃剚剤'BTU'PXBSE䘰鱲⟃⿻ 㥶⡦鼚⯝ ˖ 㥶⡦㖈ざ⢘ⴕ佅儘鍑对遼瑳ㄤ岤䠑✲갪
˖ ⴕ佅涸劥颶僽➊랃
2"儘
5IBOL:PV