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
34
版本控管了沒? Coders 必備!
Taipei Creative Coders #8
版本控管了沒? Coders 必備!
一個非常粗略的版本控管工具介紹
Tom Chen
May 05, 2021
Tweet
Share
Other Decks in Programming
See All in Programming
Open standards for building event-driven applications in the cloud
meteatamel
0
190
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
450
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
290
GitLab CI/CD で C#/WPFアプリケーションのテストとインストーラーのビルド・デプロイを自動化する
hacarus
0
500
Try creating your own orderedmap
kazamori
1
270
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
480
Node.js v22 で変わること
yosuke_furukawa
PRO
12
4.1k
Direct Style Effect Systems The Print[A] ExampleA Comprehension Aid
philipschwarz
PRO
0
280
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
840
“Seeing Like a Programmer”—Resiliency, Limits, and Moral Hazards in Software Engineering (LambdaConf 2024)
chriskrycho
0
320
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
530
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
10
1.7k
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
32
47k
The Language of Interfaces
destraynor
151
23k
The Cost Of JavaScript in 2023
addyosmani
21
3.9k
The Invisible Customer
myddelton
114
12k
The Power of CSS Pseudo Elements
geoffreycrofte
62
5k
KATA
mclloyd
16
12k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
Facilitating Awesome Meetings
lara
43
5.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
39
2.5k
Done Done
chrislema
178
15k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
242
1.2M
Infographics Made Easy
chrislema
238
18k
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?