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 九淺一深
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
JohnsonLu
January 23, 2015
Education
400
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Git 九淺一深
我佛你第 1 次 讀書會簡報
JohnsonLu
January 23, 2015
More Decks by JohnsonLu
See All by JohnsonLu
觀落陰 AngularJS
johnson4932
2
130
Laravel 九淺一深
johnson4932
2
250
Other Decks in Education
See All in Education
LEGO Geometry Tutorial
arnoknobbe
0
720
1002
cbtlibrary
0
350
Adobe Express
matleenalaakso
2
8.4k
Science Tokyo University for International Research Excellence scheme_April 2026
sciencetokyo
PRO
0
520
Sanapilvet opetuksessa
matleenalaakso
1
36k
AIの力を100%引き出すために
frievea
0
610
吉岡研究室紹介(2026年度)
kentaroy47
0
350
Modulo : abc
robintux
0
240
未踏峰連山 Frontiers: Creating and Conquering Untrodden Peaks
ishii_mit
1
170
私たちはなんでテストするんだっけ? Ver.東北IT物産展2026 in 会津若松
camel_404
3
220
Merger Process
bvr7352
0
170
武藤の処世術を書いてみた
mutomasa
0
140
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
520
Marketing to machines
jonoalderson
1
5.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
940
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Faster Mobile Websites
deanohume
310
32k
A designer walks into a library…
pauljervisheath
211
25k
Transcript
Git 九淺⼀一深 JohnsonLu
• Introduction • Misuse • Commit Policy • Config •
Branch • Tips • Rebase & Cherry-pick • Sub Module • Hooks • Multiple Remote
Introduction
Local version control
Centralized version control
Distributed version control
None
The Three States
Misuse
–⾺馬雲 「版本控制不是複製整個資料夾。」
⼟土炮版本控制
None
–⾺馬國畢 「版本控制是要可以”控制”。」
None
None
–⾺馬英九 「版本控制的過程⼈人要看的懂。」
None
None
Commit Policy
• Separate subject from body with a blank line •
Limit the subject line to 50 characters • Capitalize the subject line • Do not end the subject line with a period • Use the imperative mood in the subject line • Wrap the body at 72 characters • Use the body to explain what and why vs. how
None
None
Config
• git config --global user.name “JohnsonLu" • git config --global
user.email
[email protected]
• git config --global core.editor vim • git config —list • git config --global push.default <matching or simple>
Branch
None
• git branch #列出⺫⽬目前有多少branch • git branch -a #列出所有branch •
git branch test-branch #產⽣生新的branch • git branch test-branch master #由master產⽣生新的branch • git branch -d test-branch #刪除branch • git branch -D test-branch #強制刪除branch • git checkout branch-name #切換到branch-name • git checkout master #切換到master • git checkout -b test-branch master #從master建⽴立新的branch,並同時切換過去 • git checkout <commit_hash> -b test #切換到某次commit並建⽴立新的branch
–⾺馬世莉 「如何拆解branch?」
Filter-Branch • git filter-branch --subdirectory-filter public -- --all
Tips
• add -p • reflog • stash • tag
• git tag -l #列出所有標籤 • git tag -a ver.1
-m "First Version” • git show <tag> • git tag -a <tag> <commit-hash> #針對特定 commit做tag • git push <origin> —tags #push 所有tag
Rebase & Cherry-pick
None
• 1.暫存⼀一份本機repository從上次pull之後再修改 的部份 • 2.將本機repository rollback到上⼀一次pull的狀況 • 3.套⽤用遠端的變更 • 4.套⽤用暫存下來的本地變更
• 1.git rebase <branch> • 2.當遇到檔案內容衝突時,修改並git add • 3.git rebase
--continue
cherry-pick
Sub Module
• git submodule add <origin> <dir_name> • git submodule init
#在.git/config 中加⼊入 submodule 設定 • git submodule update #把整個submodule clone 下來
Hooks
• .git/hooks
Multiple Remote
None
None
None
• git remote • git remote add [shortname] [url] •
git pull [shortname] [branch]
–⾺馬世莉 「Q & A」