Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Git Branch
Search
高見龍
June 04, 2018
Technology
460
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Git Branch
Git 小聚:Git 跟你想的不一樣(Part 1)
高見龍
June 04, 2018
Transcript
72 slides
(JU᪑你తෆҰᒬ 高見龍 1BSUࢧ
ൣྫ檔Ҋ https://bit.ly/2IQEwUR
ࣗզհ
a.k.a Eddie 愛現! 喜歡冷門的玩具 Ruby/Rails/iOS app 開發者、講師 Ruby 技術推廣、教育、諮詢 台灣、日本等國內外
Ruby 技術研討會講者 目前於五倍紅寶石擔任紅寶石鑑定商職務 部落格:https://kaochenlong.com 高見龍 photo by Eddie @eddiekao
發售中! https://railsbook.tw/
發售中! https://gitbook.tw/
։࢝೭લ
༗ᔒ༗ୈҰ࣍ᡒա (JUṜࡾݸࣈతਓ
https://gitbook.tw/
࡞্༗ࡏ༻(JUɼୠ ༗(JUᙛ'51ࡏ༻ʁ
ိݯɿIUUQTYLDEDPN ʮṜबੋ(JUɼሏ༻Ұछඬ྄ తࢄࣜᅷܕཧܕతٕज़ိ ᪦զ၇ሢҊత㚎༰ʯ ʮࠅʂṜཁዎኄ༻ʁʯ ʮෆಓɼେ֓बੋهҰࠣऴػ ࢦྩ ɼ ࢦྩᏏҰᏏ䈕Ҋब။ಉ㑊ྃ ɻ
Ռᚙੜɼઌ䈕Ҋઌඋ㟨Ұ 㟨౸ผతํɼሢҊ䜤ᎃɼવޙ ॏ৽ԼࡌҰ㟨શ৽తሢҊबߦྃ ɻ ʯ
ຊจ։࢝
൛ຊ߇੍ 7FSTJPO$POUSPM
! 那個...你有聽過 Git 嗎? 那是什麼? " 啊就一種分散式的版本控制系統啊! # 分散? 版本?
? ? ? ?
ॄኄ൛ຊ ཁ߇੍ॄኄ
ॴҎɼॄኄੋʮ൛ຊʯ
版本2 版本3 版本4 版本5 版本1 2016/2/8 2016/2/10 2016/5/8 2016/8/22 2016/11/28
ࢄࣜ
$ Sherly " Eddie % Emily & Picasso Octocat 我做好三角
型囉! 我改了兩個 圈圈! 收到! 收到! 收到! 我刪了一個 方塊! OK, 好! OK, 好!
උ份 ब૾؝༡ፍత࣌ީ။Ṷଘ༡ፍਐҰᒬ
㑖࢙ل㑚ٴᨽᎦ ग़ࣄత࣌ީ你။ಓੋኺॄኄ࣌ީ։࢝ब༗ɼ Ҏٴಓ֘ፙ୭ိഃ
$PODVSSFOU7FSTJPOT4ZTUFN $74 TJODF
4VCWFSTJPO 47/
ੋ
Ռᔒ༗࿏ɼ҃ੋ47/త ثނোత࣌ީศແ๏༻
ᔒ༗࿏बෆೳሜDPEFʁ (JU)VCᆦᎃత࣌ީେՈ။։؝সత說ՄҎԼ൝ྃ 哈囉, 你好!
(JU
-JOVT5PSWBMET GPSNBOBHJOH-JOVYLFSOFM TPVSDFDPEFJO photo by Krd
Ұఆཁ༻ऴػࢦྩ嗎
None
ࢧ #SBODI
ሣࢧతޡղ 你૾தతࢧॄኄᒬࢠ
photo by Mark Fischer
photo by Caroline
ࢧੋҰு షࡏݸ$PNNJU্తషࢴ
ࢧศٓత ҝॄኄ
ॄኄ࣌ީཁ༻ࢧ
৽⃧ࢧDBU $ git branch cat ᒾࢹࢧ $ git branch cat
* master $ git branch -d cat Deleted branch cat (was cb96971). ႟আࢧDBU
౸DBUࢧ $ git checkout cat ౸EPHࢧɼՌ֘ࢧෆଘࡏɼ ။ࣗಈݐཱ৽తࢧ $ git checkout
-b dog
߹ซࢧ
ଖመࢧੋᔒ辦๏߹ซత 你߹ซతੋࢧॴࢦ౸త$PNNJU
߹ซࢧDBU $ git checkout master $ git merge cat
߹ซաతࢧՄҎ႟ᎃ嗎
ཁዎኄऔফ߶߶Ṝ࣍త߹ซ 㐫گ
զ༗ࠣਓతࢧ༗ىိ૾ ࢧతʮখࣖ朵ʯઢᅷɼዎኄ զతࢧᔒ༗ 就是這種東西 㐫گ
Ҽҝෆधཁ啊ʂ
$ git merge cat --no-ff ඇշ߹ซ 'BTI'PSXBSE
ᚙੜিಥ $POqJDU ྃɼዎኄ辦 㐫گ
༻3FCBTF߹ซ
photo by UGA College of Ag & Environmental Sciences
e076c8 35c42e b43d89 f17acb 76ccce 981ad3 dog cat master HEAD
$ 3FCBTF߹ซ
35c42e 76ccce 981ad3 dog master b43d89 f17acb cat HEAD $
git rebase dog 3FCBTF߹ซ
f17acb b43d89 35c42e 76ccce 981ad3 dog master b43d89 f17acb cat
HEAD $ git rebase dog c871e3 ab12cd cat HEAD 3FCBTF߹ซ
3FCBTFෆੋႩԼష্
ཁዎኄऔফ ߶߶Ṝ࣍తSFCBTF߹ซ 㐫گ
ଖሏৗݟ㐫گ
༗ࠣൺֱػີత檔Ҋզෆ์ࡏ (JUཫ໘Ұىඋ份 㐫گ
HJUJHOPSF https://github.com/github/gitignore
你ෆখ৺ாᥒີᛰሜࡏݸ檔 Ҋཫɼఏަࣕਪग़ڈྃ 㐫گ
$ git filter-branch --tree-filter "rm -f config/password.txt" ሣ㑌ݸઅᴍ႟আಛఆ檔Ҋ
ਫ਼ਆෆɼෆখ৺༌ೖྃHJU SFTFU)&"%?IBSEࢦྩɼ檔 Ҋؐٹಘճိ嗎 㐫گ
ௐ閱SFqPH $ git reflog $ git reset --hard 823520ed ճ౸SFTFU೭લతઅᴍ
લҰఱᔒਭɼෆখ৺ؐᔒ߹ ซతࢧ႟ᎃྃɼٹಘճိ嗎 㐫گ
ௐ閱SFqPH $ git reflog $ git checkout -b new_branch_name 823520ed
༻ಹݸઅᴍ၏ग़৽తCSBODI
ҝॄኄ༗࣌ީ။ਪෆ্ڈʁ
ख䳾ଠຫ
ຊိෆ༻ Ṝটతʂ
ߋଟ㐫گɼჩ閱 IUUQTHJUCPPLUX
⾼高⾒見見龍 Blog Facebook Twitter Email Mobile https://kaochenlong.com https://www.facebook.com/eddiekao https://twitter.com/eddiekao
[email protected]
+886-928-617-687
(JUখঞ
ଘეҬ 4UBHJOH"SFB ࡞㑚 8PSLJOH%JSFDUPSZ Ṷଘݿ ຊ 3FQPTJUPSZ HJUBEE HJUDPNNJU
HJUQVTI HJUQVMM HJUSFTFU HJUSNDBDIFE Ṷଘݿ ԕ 3FQPTJUPSZ
暫存區域 Staging Area 工作目錄 Working Directory 儲存庫(本地) Repository git add
git commit git reset git rm --cached 儲存庫(遠端) Repository git push git pull $ git config --global user.name "5xruby" $ git config --global user.email "
[email protected]
" 設定: $ git init 初始化: $ git add FILENAME 把檔案加到暫存區域: $ git status 查看狀態: $ git commit -m "add index.html" 提交: $ git log 檢視紀錄: $ git reset HEAD^ 取消最後一次提交: $ git branch 5xruby 新增分支 "5xruby": $ git branch 檢視目前分支: $ git branch -d 5xruby 刪除已合併分支 "5xruby": $ git checkout 5xruby 切換分支到 "5xruby" : $ git merge 5xruby 合併分支 "5xruby": $ git remote add origin REMOTE_URL 新增遠端節點 "origin": $ git remote -v 檢視遠端節點: $ git remote rm origin 刪除遠端節點 "origin": $ git push origin master 把 "master" 分支內容推往 "origin" 節點: $ git pull origin master 把遠端 "origin" 節點的 "master" 拉回本機並進行合併:
More Decks by 高見龍
See All by 高見龍
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
750
自己的售票系統自己做!
eddie
0
790
AI Agent 時代的開發者生存指南
eddie
4
3k
print("Hello, World")
eddie
2
780
為你自己學 Python - 冷知識篇
eddie
1
580
為你自己學 Python
eddie
0
890
Generative AI 年會小聚 - AI 教我寫程式
eddie
0
350
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
850
AI 時代的程式語言學習法
eddie
0
380
Other Decks in Technology
See All in Technology
MCPでネットワーク障害調査を自動化する前に直すべき3つのこと
yama3133
1
630
Re:ゼロから始めるシェアハウスのペットな鯖
silmin_
0
250
AIで実装が加速したのに、 なぜ私は仕事の大半で人と話し続けていたのか?
say_no_w
0
190
AI-Ready なデータ基盤ってなに? & 新卒未経験が、いま考えていること
imuta
0
810
20261113_JAWS_Osaka
takuyay0ne
1
590
CloudTrail を推したい
kazzpapa3
1
140
お風呂場をサーバルームにしよう
yusuke427
0
360
専門家に使ってもらうAIプロダクトをつくる - 病院の医事課向けDPCコーディング支援システムの設計と評価
hagino3000
4
890
Linuxネットワークスタック進化の軌跡: 過去10年の歩みと最新トレンド
orimanabu
4
760
人間+AIを「チーム」としてプロセスを再設計する
littlehands
4
3.5k
統制されたID・権限をどう利用するか : DPoP/FAPIによるAPIセキュリティ強化
oidfj
1
190
閉域網でのAPI公開の選択肢全部比較!
takano0131
4
570
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Navigating Team Friction
lara
192
16k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
300
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
How to build a perfect <img>
jonoalderson
1
6.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
380
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
530
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
The Pragmatic Product Professional
lauravandoore
37
7.5k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
470