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
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
第2部-高校生とAI活用/high-school2026-2
okana2ki
0
160
[2026前期火5] 論理学(京都大学文学部 前期 第10回)「論理学の哲学——意味とは何か(Tonkと推論主義)」
yatabe
0
300
Visionary Initiative: Future Intelligence 「未来の知性と社会の礎を築く」|Science Tokyo(東京科学大学)
sciencetokyo
PRO
0
1.6k
学習者データを「見る」:外国語教師のためのデータの入力、分析、解釈方法
uranoken
0
320
批判的応用言語学ワークショップ(2026-08-12 お茶の⽔⼥⼦⼤学)
terasawat
0
190
Visionary Initiative: Materials-Positive Society — Evolving “Things,” empowering a positive society | Science Tokyo
sciencetokyo
PRO
0
250
武藤の処世術を書いてみた
mutomasa
0
110
Πλουτοκρατία: Η Τυραννία του Μαμμωνά και η Μεταανθρώπινη Δουλεία
amethyst1
0
310
AWS Skill Builderを活用した一石二鳥の業務計画
ysaeki
0
140
Plano urbano de Madrid desde el Ensanche al s. XXI (2ª parte).
juanmartin2026
1
62k
Carbohydrates: Classification, Structure & Chemical Properties
pawan5505
0
220
AIってなぁに?
kenichiota0711
0
790
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
230
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Designing for Timeless Needs
cassininazir
1
470
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
270
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
270
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.2k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
420
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」