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
70
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
From Natural Language to K8s Operations: The MCP Architecture and Practice of kubectl-ai
appleboy
0
540
What’s MCP && Authorization?
appleboy
0
90
Building a Unified API Gateway for Secure and Scalable Cross-Cloud AI Service
appleboy
0
1.5k
Building MCP (Model Context Protocol) with Golang
appleboy
0
2.7k
如何設計一套具備 Container 容器化技術的 CI/CD 平台?
appleboy
0
1.6k
生成式 AI CodeGPT 開發經驗談
appleboy
0
3.2k
打造 MLOps 平台 改善 AI 模型開發流程
appleboy
0
2.3k
自動化監控伺服器工具 - Gatus
appleboy
0
4.1k
Drone CI/CD 自動化測試及部署
appleboy
1
530
Other Decks in Technology
See All in Technology
旧から新へ: 大規模ウェブクローラの Perl から Go への移行 / YAPC::Fukuoka 2025
motemen
1
590
コンピューティングリソース何を使えばいいの?
tomokusaba
1
130
開発者が知っておきたい複雑さの正体/where-the-complexity-comes-from
hanhan1978
6
2.4k
ググるより、AIに聞こう - Don’t Google it, ask AI
oikon48
0
820
【AWS reInvent 2025 関西組 事前勉強会】re:Inventの“感動と興奮”を思い出してモチベ爆上げしたいです
ttelltte
0
130
AWS資格は取ったけどIAMロールを腹落ちできてなかったので、年内に整理してみた
hiro_eng_
0
190
“それなりに”安全なWebアプリケーションの作り方
xryuseix
0
270
AI時代に必要なデータプラットフォームの要件とは by @Kazaneya_PR / 20251107
kazaneya
PRO
4
960
探求の技術
azukiazusa1
3
860
「データ無い! 腹立つ! 推論する!」から 「データ無い! 腹立つ! データを作る」へ チームでデータを作り、育てられるようにするまで / How can we create, use, and maintain data ourselves?
moznion
6
3.3k
これからアウトプットする人たちへ - アウトプットを支える技術 / that support output
soudai
PRO
16
5.2k
Introducing RFC9111 / YAPC::Fukuoka 2025
k1low
1
210
Featured
See All Featured
Bash Introduction
62gerente
615
210k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
A designer walks into a library…
pauljervisheath
210
24k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Six Lessons from altMBA
skipperchong
29
4.1k
The Pragmatic Product Professional
lauravandoore
36
7k
Statistics for Hackers
jakevdp
799
220k
Balancing Empowerment & Direction
lara
5
740
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Mobile First: as difficult as doing things right
swwweet
225
10k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
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