{"id":398,"date":"2014-08-07T08:06:14","date_gmt":"2014-08-07T06:06:14","guid":{"rendered":"https:\/\/devpath.pro\/?p=398"},"modified":"2014-08-07T08:06:14","modified_gmt":"2014-08-07T06:06:14","slug":"branching-model-clean-up-those-repos","status":"publish","type":"post","link":"https:\/\/fabiocicerchia.it\/programming\/branching-model-clean-up-those-repos","title":{"rendered":"Branching Model: clean-up those repos"},"content":{"rendered":"\n
Usually, most rookie developers don’t use a VCS (Versioning Control System), like SVN<\/a>\u00a0or\u00a0GIT<\/a>, in this post I won’t talk about the benefits of using one. This post is dedicated to who are already using a VCS without using a branching model.<\/p>\n\n\n\n So, what’s a branch? A branch is a\u00a0separate development line<\/strong>, where you or your team can work on to develop a single functionality or even an entire release. This line is separated from the rest in order not to mix unfinished functionalities and avoid to push them to the mainline or deploy them in production.<\/p>\n\n\n\n The solution is having two or more distinct lines (aka branches) so your team can work on those lines of development without interfering with each other.<\/p>\n\n\n\n The images above are referring to the\u00a0Git Flow<\/a>.<\/p>\n\n\n\n Generally, common sense dictate to have the following branches:<\/p>\n\n\n\n In git, the tags are not actually physical branches like in SVN but just snapshots<\/strong>, as what they are supposed to be.<\/p>\n\n\n\n The\u00a0 Juan Batiz-Benet<\/a>\u00a0created a\u00a0gist<\/a>\u00a0in which he’s explaining this simple model, that I’m quite sure it’s used by many developers without even being aware of it.<\/p>\n\n\n\n There are several different branching models, and most of the time you are already using one. I recommend to\u00a0start with a simple model<\/em>, and then (only if you really need) move towards a\u00a0more complex one<\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":" Usually, most rookie developers don’t use a VCS (Versioning Control System), like SVN\u00a0or\u00a0GIT, in this post I won’t talk about the benefits of using one. This post is dedicated to who are already using a VCS without using a branching model. So, what’s a branch? A branch is a\u00a0separate development line, where you or your […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","footnotes":""},"categories":[37],"tags":[81,82,83,84,85,80],"aioseo_notices":[],"author_meta":{"display_name":"fabio","author_link":"https:\/\/fabiocicerchia.it\/author\/fabio"},"featured_img":null,"coauthors":[],"tax_additional":{"categories":{"linked":["Programming<\/a>"],"unlinked":["Programming<\/span>"]},"tags":{"linked":["branches<\/a>","flow<\/a>","git<\/a>","svn<\/a>","tags<\/a>","versioning<\/a>"],"unlinked":["branches<\/span>","flow<\/span>","git<\/span>","svn<\/span>","tags<\/span>","versioning<\/span>"]}},"comment_count":"0","relative_dates":{"created":"Posted 10 years ago","modified":"Updated 10 years ago"},"absolute_dates":{"created":"Posted on August 7, 2014","modified":"Updated on August 7, 2014"},"absolute_dates_time":{"created":"Posted on August 7, 2014 8:06 am","modified":"Updated on August 7, 2014 8:06 am"},"featured_img_caption":"","series_order":"","_links":{"self":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/posts\/398"}],"collection":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/comments?post=398"}],"version-history":[{"count":0,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/posts\/398\/revisions"}],"wp:attachment":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/media?parent=398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/categories?post=398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/tags?post=398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<\/a><\/figure>\n<\/div>\n\n\n\n
<\/a><\/figure>\n<\/div>\n\n\n\n
\n
master<\/code>\u00a0\/\u00a0
trunk<\/code>\u00a0must have the\u00a0stable version<\/strong>, generally the latest version.
It’s highly recommended to tag it in order to have an\u00a0archive<\/em>\u00a0of each deployed version (e.g. useful in case you need to\u00a0rollback<\/em>).
As a suggestion the master contains only the stable version merged from the development branches, avoiding to commit directly into it keeps the history tidy and clean.
The dev branches contain the\u00a0unstable code <\/strong>which is under development. Quite often it’s possible to have a branch for each version, in case of bug fixing or maintenance.<\/p>\n\n\n\n
At the moment there are mainly two ones:<\/p>\n\n\n\n\n
The general idea is to have several branches, each for a different purpose:\u00a0master<\/code>,\u00a0
develop<\/code>,\u00a0
feature<\/code>,\u00a0
release<\/code>, and\u00a0
hotfix<\/code>.<\/li>\n
The general idea is just to have two branches:\u00a0master<\/code>\u00a0and descriptive branches for the functionalities you are working on.<\/li>\n<\/ul>\n\n\n\n