Skip to Content
成為卓越程式設計師的38項必修法則
book

成為卓越程式設計師的38項必修法則

by Pete Goodliffe
May 2015
Intermediate to advanced
376 pages
5h 48m
Chinese
GoTop Information, Inc.
Content preview from 成為卓越程式設計師的38項必修法則
182
| 第二十章:有效的版本控制
y
不要把你
認為
將來有一天可能會用到的東西存在儲存庫裡。記得:你
可以
在版本控
制刪除認何東西,只要它不符合目前的最新狀況(這樣做是百分之百安全的,它還
是會在封存區裡面)。不要保留可丟掉的數位包袱。
重點
版本控制下儲存
所有
組成軟體專案的東西。但是儲存得
愈少愈好
不要加入任何沒必要的檔案。
儲存軟體版本
你應該將你所組建的軟體版本存在版本控制底下嗎?有些商店會將他們的釋出版放到存
儲庫裡。這通常是一個獨立的“釋出”存放區,二進位檔並不是真的適合放在原始檔案
旁邊。
考慮將它們放在另一個簡單的靜態目錄結構中。當你幫以後的人記錄較不動態的檔案結
構時,版本控制不會給你更多幫助。在檔案伺服器上瀏覽這種封存對象會比較容易。
存儲配置
仔細地構思你的存放區的配置。確保目錄結構的清晰,讓它揭示程式的樣貌。在頂層加
入實用的“read me”文件。[Page-176]
無情地避免重複行為。如同重複的程式會產生很多 bug,在存放區儲存重複的檔案也是
如此。
謹慎地管理第三方程式。把它與你自己的原始檔案分開。將它放在清楚標示的子目錄。
這可幫助你追蹤第三方的修改,而不會與自己的檔案混淆。
確保你的存放區被設置為忽略不適當的檔案。大部分的系統都可以使用模式匹配規則來
忽略某些檔案。這可幫助你不小心 check in 個人設定檔、衍生檔,等等。
善用版本控制
|
183
善用版本控制
“改變”與“變得更好”是不一樣的事情。
- Proverb
如果黃金規則是:“使用版本控制”,那麼銀色規則就是:“
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

精通機器學習|使用Python

精通機器學習|使用Python

Sarah Guido, Andreas C. Mueller
Java性能优化实践:JVM调优策略、工具与技巧

Java性能优化实践:JVM调优策略、工具与技巧

Benjamin J. Evans, James Gough, Chris Newland

Publisher Resources

ISBN: 9789863475699