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
Git Flow and Coding Style
Search
Bo-Yi Wu
January 24, 2016
Technology
0
52
Git Flow and Coding Style
Bo-Yi Wu
January 24, 2016
Tweet
Share
More Decks by Bo-Yi Wu
See All by Bo-Yi Wu
生成式 AI CodeGPT 開發經驗談
appleboy
0
1.8k
打造 MLOps 平台 改善 AI 模型開發流程
appleboy
0
1.6k
自動化監控伺服器工具 - Gatus
appleboy
0
3.3k
Drone CI/CD 自動化測試及部署
appleboy
0
350
初探 Infrastructure as Code 工具 Pulumi
appleboy
2
3.2k
Introduction to Open Policy Agent
appleboy
0
1.6k
善用 Go 語言效能測試工具來提升執行效率
appleboy
2
4.1k
用 Go 語言打造多台機器 Scale 架構
appleboy
1
4.4k
Job Queue in Golang
appleboy
1
1.1k
Other Decks in Technology
See All in Technology
よく聞くけど使ったことないソフトウェアNo.1 KafkaとSnowflake
foursue
4
340
長期運用プロジェクトでのMySQLからTiDB移行の検証
colopl
2
830
最近たまに見かけるTiDBってなんだ? - Findy
pingcap0315
2
760
Next'24 事例セッションの紹介とクラウド資格を活用したキャリア形成について語りMuscle
yasumuusan
1
430
非同期推論システムによるコスト削減と信頼性向上
koki_nishihara
0
180
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
120
web-application-security
matsuihidetoshi
0
140
自己改善からチームを動かす! 「セルフエンジニアリングマネージャー」のすゝめ
shoota
6
270
レガシーをぶっ壊せ。AEONで始めるDevRelの話 / Qiita Night 2024-2-22
aeonpeople
3
1.3k
反実仮想機械学習とは何か
usaito
PRO
10
3.7k
プロトタイピングによる不確実性の低減 / Reducing Uncertainty through Prototyping
ohbarye
5
380
MLOpsの「壁」を乗り越える、LINEヤフーの Data Quality as Code
lycorptech_jp
PRO
5
430
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
2
3.4k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
Into the Great Unknown - MozCon
thekraken
10
990
How to name files
jennybc
65
93k
Statistics for Hackers
jakevdp
789
220k
Rails Girls Zürich Keynote
gr2m
91
13k
How to Ace a Technical Interview
jacobian
272
22k
For a Future-Friendly Web
brad_frost
172
9k
A designer walks into a library…
pauljervisheath
200
23k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
244
20k
Teambox: Starting and Learning
jrom
128
8.4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
120
39k
Transcript
Git Flow and Coding Style Bo-Yi Wu 2015/04/10
Agenda • Git merge vs Git rebase. • JavaScript Coding
Style.
Git merge vs Git rebase
Git merge • Create your branch – $ git checkout –b
‘response’ • Merge from develop branch – $ git merge develop
None
git merge develop
None
New commit Merge branch 'develop' into response (HEAD, response)
None
git merge develop again
None
New commit Merge branch 'develop' into response (HEAD, response)
git checkout develop git merge --no-ff response
None
Git rebase • Create your branch – $ git checkout –b
‘response’ • Merge from master branch – $ git rebase develop
None
Git rebase master
None
No more new commit log
Git rebase master again
None
No more new commit log
Create your new Pull Request git merge --no-ff respnse
None
git rebase vs git merge network graph
None
Rebase vs Merge 優缺點 rebase merge 避免過多 merge
commit log 產生 merge commit log Branch commit log 排到最前面(方便追 蹤) 依照時間排序 commit log network graph 清楚 network graph 不易理解 各別 commit 解決 conflict 一次將全部衝突顯示 可任意修改 commit log 可合併多個 commit (避免過多無意義 commit log)
Rebase vs Merge 使用時機 rebase merge 整理 Branch
commit log 主分支記錄合併 xxxx branch 非主分支開發無需記錄何時合併主分支 主分支請勿使用 rebase 合併任何分支
Develop Note Please rebase master branch and test again before
creating new Pull Request
JavaScript Coding Style Guide
原先架構 https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
Google JavaScript Style Guide 無任何範例可參考
Airbnb JavaScript Style Guide https://github.com/airbnb/javascript
Airbnb JavaScript Style Guide 程式碼範例完整 另外也可以參考 ES6 Branch
Yoda Conditions https://en.wikipedia.org/wiki/Yoda_conditions if ($a === ‘1’) { // code
block } if (‘1’ === $a) { // code block } 程式閱讀性高 程式閱讀性低
Yoda Conditions https://en.wikipedia.org/wiki/Yoda_conditions if ($a = ‘1’) { // code
block } 避免此種情況發生
How to prevent the condition? Write Unit Test
Thanks