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
版本控管了沒? Coders 必備!
Search
Tom Chen
May 05, 2021
Programming
0
39
版本控管了沒? Coders 必備!
Taipei Creative Coders #8
版本控管了沒? Coders 必備!
一個非常粗略的版本控管工具介紹
Tom Chen
May 05, 2021
Tweet
Share
Other Decks in Programming
See All in Programming
Namespace and Its Future
tagomoris
6
700
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
基礎から学ぶ大画面対応(Learning Large-Screen Support from the Ground Up)
tomoya0x00
0
430
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
22
5.7k
請來的 AI Agent 同事們在寫程式時,怎麼用 pytest 去除各種幻想與盲點
keitheis
0
120
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
Kiroの仕様駆動開発から見えてきたAIコーディングとの正しい付き合い方
clshinji
1
210
ソフトウェアテスト徹底指南書の紹介
goyoki
1
150
実用的なGOCACHEPROG実装をするために / golang.tokyo #40
mazrean
1
270
🔨 小さなビルドシステムを作る
momeemt
4
680
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.3k
AI Coding Agentのセキュリティリスク:PRの自己承認とメルカリの対策
s3h
0
200
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Git: the NoSQL Database
bkeepers
PRO
431
66k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
The World Runs on Bad Software
bkeepers
PRO
70
11k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
How to Ace a Technical Interview
jacobian
279
23k
Statistics for Hackers
jakevdp
799
220k
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Transcript
Tom Chen 2021/5/5 版本控制了沒? Coders 必備! Taipei creative coders Meetup
#8
今天是⼀個超級粗略的介紹
主要是希望還沒在⽤的⼈可以開始
我不會在這邊跟⼤家過指令
Source Control CVS Subversion (svn) Perforce (p4) StarTeam Git Mercurial
(hg) Plastic SCM
有什麼好處?
清楚每⼀次做了哪些 更動 - ⽅便回復 - Debug - 記錄⼯時 - 協作
- Code Review https://github.com/yychen/dj-registry/commits/master
基本概念 Working Directory Staging Area Repository ⽬前的⼯作⽬錄 暫存區域 儲存庫 sketch.js
README.md ⿊⾊:Untracked Files (未追蹤)
基本概念 Working Directory Staging Area Repository ⽬前的⼯作⽬錄 暫存區域 儲存庫 sketch.js
README.md 藍⾊:Staged Files (暫存區) sketch.js README.md git add
基本概念 Working Directory Staging Area Repository ⽬前的⼯作⽬錄 暫存區域 儲存庫 sketch.js
README.md 綠⾊:Committed Files (已存入) sketch.js README.md git commit sketch.js README.md 46a1c361
基本概念 Working Directory Staging Area Repository ⽬前的⼯作⽬錄 暫存區域 儲存庫 sketch.js
README.md 紅⾊:有更動 ⿊⾊:Untracked Files (未追蹤) 綠⾊:Committed Files (已存入) sketch.js README.md 46a1c361 logo.png
基本概念 Working Directory Staging Area Repository ⽬前的⼯作⽬錄 暫存區域 儲存庫 sketch.js
README.md 藍⾊:Staged Files (暫存區) 綠⾊:Committed Files (已存入) sketch.js README.md 46a1c361 logo.png sketch.js logo.png git add
基本概念 Working Directory Staging Area Repository ⽬前的⼯作⽬錄 暫存區域 儲存庫 sketch.js
README.md 藍⾊:Staged Files (暫存區) 綠⾊:Committed Files (已存入) sketch.js README.md 46a1c361 logo.png git commit sketch.js logo.png sketch.js logo.png ad1eec42 README.md
基本概念 Working Directory Staging Area Repository ⽬前的⼯作⽬錄 暫存區域 儲存庫 sketch.js
README.md sketch.js 46a1c361 logo.png git push sketch.js logo.png ad1eec42 README.md Repository GitHub
基本概念 Working Directory Staging Area Repository ⽬前的⼯作⽬錄 暫存區域 儲存庫 sketch.js
README.md sketch.js 46a1c361 logo.png git pull sketch.js logo.png ad1eec42 README.md Repository GitHub
基本概念 Working Directory Staging Area Repository ⽬前的⼯作⽬錄 暫存區域 儲存庫 sketch.js
README.md sketch.js 46a1c361 logo.png git pull sketch.js logo.png ad1eec42 README.md Repository GitHub Merge Con fl ict
養成好習慣
不要⼀⼝氣加 (整個⽬錄) git add . 除非你很清楚你加了什麼
看清楚加了什麼 git status
今天的範例在 https://github.com/yychen/tcc-git-django-sample
None
None
看清楚加了什麼 git diff
None
⾦鑰、密碼千萬不要進
這種東⻄進去了 無比的⿇煩
進了怎麼辦? https://docs.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository
看清楚加了什麼 git status
看清楚加了什麼 git diff
每次加,都清楚加了什麼 git commit 對⾃⼰進的 code 負責
也不要進被產⽣出來的檔案 build、.exe、xxx_Data、.dll .DS_Store、thumbs.db .vscode (?) 原則上 https://stackover fl ow.com/questions/32964920/should-i-commit-the-vscode-folder-to-source-control
你的儲存庫 (repository) 原則上 存放最終可產⽣、執⾏的原始碼 以及相關⽂件
None
換句話說 某君從儲存庫拉下來⼀整包 就要可以從這⼀包東⻄ 產⽣出⼀個⼀樣的可執⾏的東⻄ 包含說明⽂件、如何把建制的環境建立起來、測試... 等資訊
.gitignore
多久 commit ⼀次? https://softwareengineering.stackexchange.com/questions/74764/how-often-should-i-do-you-make-commits
commit message 怎麼寫 • https://chris.beams.io/posts/git-commit/ • https://hackmd.io/@yenWu/HJQk5dt2x?type=view (中⽂版) • https://wiki.openstack.org/wiki/GitCommitMessages
Git LFS 那些超⼤張的圖檔、.PSD、聲⾳檔、所有影片相關的、.abc、非⽂字檔...
A Successful Git branching model https://nvie.com/posts/a-successful-git-branching-model/ Branch
協同合作 • https://github.com/pycontw/pycon.tw/pull/800 • https://github.com/pycontw/pycon.tw/pull/921 • https://github.com/pycontw/pycon.tw/pull/884 • https://github.com/pycontw/pycon.tw/pull/885 Issue
/ Merge Request (Pull Request) / Review
Any questions?