一個成功的Git分支模型
A successful Git branching model
[參考原文]https://nvie.com/posts/a-successful-git-branching-model/
作者: Vincent Driessen
on Tuesday, January 05, 2010
在本文中南捂,我介紹了大約一年前我為一些項目(工作和私有)介紹的開發(fā)模型,結(jié)果證明非常成功鳖眼。 我一直想寫一段時間黑毅,但直到現(xiàn)在我才真正抽出時間做這件事。 我不會談?wù)撊魏雾椖康募毠?jié)钦讳,只是關(guān)于分支策略和發(fā)布管理矿瘦。
In this post I present the development model that I’ve introduced for some of my projects (both at work and private) about a year ago, and which has turned out to be very successful. I’ve been meaning to write about it for a while now, but I’ve never really found the time to do so thoroughly, until now. I won’t talk about any of the projects’ details, merely about the branching strategy and release management.
看圖由master分支開始
為什么用Git枕面?
有關(guān)Git與集中式源代碼控制系統(tǒng)相比優(yōu)缺點的詳細討論,請參閱網(wǎng)站缚去。那里有很多爭論潮秘。
Why git? ?
For a thorough discussion on the pros and cons of Git compared to centralized source code control systems, see the web. There are plenty of flame wars going on there.
pros 利弊
cons 缺點
the pros and cons 利弊
作為開發(fā)人員,我更喜歡Git易结,而不是今天的所有其他工具枕荞。
Git真的改變了開發(fā)人員對合并和分支的看法。
As a developer, I prefer Git above all other tools around today.
Git really changed the way developers think of merging and branching.
從我來自經(jīng)典的CVS / Subversion世界來看搞动,合并/分支一直被認為有點可怕(“要小心合并沖突躏精,它們會咬你!”)以及你每隔一段時間就會做的事情鹦肿。
From the classic CVS/Subversion world I came from, merging/branching has always been considered a bit scary (“beware of merge conflicts, they bite you!”) and something you only do every once in a while.
但是使用Git矗烛,這些操作非常便宜和簡單,并且它們被認為是您日常工作流程的核心部分之一箩溃。例如瞭吃,在CVS / Subversion書籍中,分支和合并首先在后面的章節(jié)中討論(對于高級用戶)涣旨,而在每本Git書中歪架,它已經(jīng)在第3章(基礎(chǔ)知識)中介紹過了。
But with Git, these actions are extremely cheap and simple, and they are considered one of the core parts of your daily workflow, really. For example, in CVS/Subversion books, branching and merging is first discussed in the later chapters (for advanced users), while in every Git book, it’s already covered in chapter 3 (basics).
由于其簡單性和重復(fù)性霹陡,分支和合并不再是一件令人害怕的事情和蚪。版本控制工具應(yīng)該比其他任何東西更有助于分支/合并。
As a consequence of its simplicity and repetitive nature, branching and merging are no longer something to be afraid of. Version control tools are supposed to assist in branching/merging more than anything else.
consequence 后果
simplicity 簡單
repetitive 重復(fù)
nature 性質(zhì)
足夠的工具穆律,讓我們進入開發(fā)模型惠呼。我將在這里介紹的模型基本上只是每個團隊成員必須遵循的一組程序才能進入托管軟件開發(fā)過程。
Enough about the tools, let’s head onto the development model. The model that I’m going to present here is essentially no more than a set of procedures that every team member has to follow in order to come to a managed software development process.
分散但集中
我們使用的存儲庫設(shè)置與該分支模型配合良好峦耘,具有中央“真實”存儲庫剔蹋。 請注意,這個倉庫只被認為是中央倉庫(因為Git是DVCS辅髓,在技術(shù)層面沒有中央倉庫)泣崩。 我們將此repo稱為origin,因為所有Git用戶都熟悉此名稱洛口。
Decentralized but centralized
The repository setup that we use and that works well with this branching model, is that with a central “truth” repo. Note that this repo is only considered to be the central one (since Git is a DVCS, there is no such thing as a central repo at a technical level). We will refer to this repo as origin, since this name is familiar to all Git users.