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
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
150
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
230
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
0
270
Web Components で実現する Hotwire とフロントエンドフレームワークの橋渡し / Bridging with Web Components
da1chi
3
2.5k
CSC509 Lecture 06
javiergs
PRO
0
260
Six and a half ridiculous things to do with Quarkus
hollycummins
0
170
明日から始めるリファクタリング
ryounasso
0
140
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
170
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
230
Swift Concurrency - 状態監視の罠
objectiveaudio
2
520
Advance Your Career with Open Source
ivargrimstad
0
540
Leading Effective Engineering Teams in the AI Era
addyosmani
5
430
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
9.6k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
The Straight Up "How To Draw Better" Workshop
denniskardys
238
140k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Optimizing for Happiness
mojombo
379
70k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
620
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
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?