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
93
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
410
From Onboarding to Value Delivering in iOS
vc7
0
230
Merciless Refactoring
vc7
0
690
Protocol 的實例、測試和心得
vc7
2
750
共有経済
vc7
0
160
.gitignore
vc7
1
75
Git Workshop 03
vc7
0
110
Escaping Closures in Swift - 公司內分享會
vc7
1
220
Git Workshop 01
vc7
0
150
Other Decks in Programming
See All in Programming
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Realtime API 入門
riofujimon
0
150
Ethereum_.pdf
nekomatu
0
470
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
120
距離関数を極める! / SESSIONS 2024
gam0022
0
290
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Amazon Qを使ってIaCを触ろう!
maruto
0
420
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Producing Creativity
orderedlist
PRO
341
39k
Embracing the Ebb and Flow
colly
84
4.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
4 Signs Your Business is Dying
shpigford
180
21k
Fireside Chat
paigeccino
34
3k
Scaling GitHub
holman
458
140k
Six Lessons from altMBA
skipperchong
27
3.5k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Side Projects
sachag
452
42k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Being A Developer After 40
akosma
87
590k
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