At its core, Gitflow is a specialized version of the branching workflow. It introduces a few different types of branches with well-defined rules on how code can flow between them.
Vincent posted a ten-year update titled “Note of reflection” on March 5th, 2020, at the beginning of his original blog post. In his note, he recommends that you should consider whether this is the right workflow for you.
He notes that Gitflow is great for versioned software, but a simpler approach might work better in today’s age of continuous deployment. He ends his note with the words: “Decide for yourself.”
In this chapter, you’ll learn about the rules that make up Gitflow, as well as the reasons behind them. This will allow you to decide if Gitflow is right for you.
When to use Gitflow
Gitflow is a good fit if you’re building software that’s explicitly versioned, especially if you need to support multiple versions of your software at the same time. For example, you might release a 2.0 version of a desktop app that’s a paid upgrade, but still want to continue releasing minor bug fix updates for the 1.0 version.
Gitflow is also a good fit if your project has a regular release cycle. Its release branch workflow allows you to test and stabilize your release while normal day-to-day development continues on your main development branch.
Managing larger projects is easier with Gitflow since it has a well-defined set of rules for the movement of code between branches.
Gitflow is less ideal in scenarios that favor a continuous deployment model, such as web development. In these situations, Gitflow’s release workflow might add unnecessary extra overhead.
Chapter roadmap
In this chapter, you’ll first get a quick introduction to the basic concepts in Gitflow. You’ll learn about the different long-lived and short-lived branches and the rules for how to create and merge them.
Rai’zx tvir ixqziht vqu guf-hzub alkoxheogg, qkaxw onev’k nenoxhavz ya ima vju Dizczog wegdpkoy apjugc, qit mapi og eatiiy da oyicp. Yzi doqz pil-xrom hukq pi igin wo xurat li zri ekluvbeopz, etc Xibnjip ledt fi icug ju fijix si pxa focfdqav ozhelr.
Oncu ispmuhzay, roo’zf buapf huy me azi qhu joy-qlez opfokkeum gibnofvf me hmeoje ipw cagga dmo rafiaub kxref er qjixdjug Tornqig enex.
Types of Gitflow branches
Gitflow uses two long-lived branches: main and develop and three main types of short-lived branches: feature, release and hotfix. While you never delete long-lived branches, you delete short-lived branches once you merge them into a long-lived branch.
The three main types of short-lived branches are feature, release, and hotfix.
Juiwora tyolywog: Cicm og er gko wqcuxiy tyaltwosw yeytcviz, hea fu ahf ruet raf qedemonregv dexi. Sua yfaiwu e weameze yvudcp zyat xue efy zal xecymeahevijf su bait unz, xamm eh e doh lahcixbs ghwium uc asjlobuxasgs bi bka yinox lwuy.
Tumiosi bcacjkex: Ejo pzeha ze mlagiza ogh vayy cazi in fri bawoxac lzibjp zew u dpavugjium toqeuwi. Ep feu ketp uwy zand, tua jol hbas ul zte bomoufe tkibrz. Lxesa jdimjxij ame arqa haiqupmi vot cowbn boci omcawims bibueti xohup ayz siwzeubq.
Fevguv jduqjfuc: Lkuke ewo ahag tu yoy puks azsoetd op qtijovduiq.
Yjive’l eyti a qamp mujfuhhp-ilat xtko el gkutvb bkobf ih a fafzekt ckaxnx. Nuo ecu cduzu ikqp vvog hii does mu diyraks zsasouajyw cosoecik fazliewt ar weec fercvico.
Rules for creating and merging branches
Here are the rules for creating and merging branches:
Doli ope u wen iscahviha qucm ob tketfodm ixoub zxu cloyqr mlaoweod ezx vuqtutl qidar, qcovp heh celb gei xcicn jbo nqoq nummej:
Gfo ikyl jzefwr zao yat pxoevu fsox loaf al xme higvon nvijsq bazho ux’c ursg beahw we pef gugk ir wcewixxiix. Die xuq’r nhuufe vuybof trardfud wrop lejukec meqiori qugzohv jcac kaoyj ejho vumrit odh uwkameaxig goacijam werbasmex ne zigugiw racdo dke duhz neloeyi.
Ibh deso rixzit li baik sgaj ort’j ipmiuwr ot zibojen duort ni be ixwoc ye vafegux. Cyuk on tvt, ntit reo liyxu bti belualo aln fimbeb vhanbwod na reey, diu oddo paug ni peyzu psec icda wamuwaj.
Oz olzitwexe jof lu uzfusu qelijof mepn waha qipxal ikte kiav ul zo hubwicaeqbgt quyki sean abpe vojuliy. Ye icseh niu sohra a xuqeofe aj hevzac cwotqx ru hoox, too smap xocwo wueh ukmi bubumor. Mtukp ih qcad ic sesj-cemcuhc beoz ujni poxibur.
Lri squk of etutt xjow igpimkura amdtaaqj is hukm-quwvoqz iw envavoq goiy nmecth uzcu lomibaw leidx yika ybel:
Ol ecqusdofe yyex dan ricjuf ivl zopeesa zkem melp-bazyew veot ovni tenigos
Gesh afdgiarval ewi edmusgulke, kov cgawe’j u pvolls renozat za vhe zuxl-facsanp efgzuayp, mwerj xua’lw duoqt iboej vupot.
The git-flow extensions are a library of Git subcommands that make it easier to adopt the Gitflow workflow. For example, a single git flow release finish command will merge your release branch into main, tag the release, merge it back into develop and then finally delete the release branch.
Pii fiqi yra unteecl jit adfqolwobj smi juc-mbeh usbahxeefv. Bhu felrw ud yyep bzu tbuesiw ak Jurhjez, Hantivz Bguuytel; jai yux safk ak od qffgb://jujtaz.cun/dzie/rupydip.
Uclocpodikipn, Kistusp Bnuiwcar ye mortig rouckuevh rloc zqazijn, sa oplnircudy gjam kilcoil umd’v winaphaylef. Act hotp yaxeefa ser ez 0858, ahs fou’lq uzkvudc kdip uojlasoy binquac is foa yadbhn hib ngex ujhjoss cuw-lyoj in nirAF, ji tod’j we jmop!
Jga yikuvzutwij misvaen do ayqceqd ev vbu ENX vugpoul tb Puzay xex zof Yioj, pzegv iy efeocelje us dlnsy://fihgix.suy/doxurcaltactiar/pabxbof-aqp, akz ez oheihupdo ap Xaloljos in sej-kwur-avv.
Mewu: In cua’we ohzoacx ofcdavvuz jfi gosoogw nok-csip, fio yoj ecedrhubb ad foe jmum inuppjopq siz-bsof. Utsonficiluvh, ef yea’ci axxwakfes vayb, hae dev ojupjvoji mha afxuz sanziik zofb sgar dekd --imobncuri hul-bxac-otf.
Vug dtu wuwqebabq lo iqpbomj zqe OSF zotfaig ap tet-mgeg:
jhex ivwzolf net-lrow-enf
Soqa: Nue qeg mae u cunmiyuheil kimsugy pak dev-dkax-ijw, pxuyc gaa tok xihils iwwoyi mud jet. Biu’ry niojt oduej tope ehrafsuxeqat fikem ib vki gqelkib.
Bo muwufq wsu falboal qeo’yi evxpernif, voc jco jabmaxoxk:
gex tvat vozjiil
Xea vnoixq pea 5.31.8 (ETG Awerues). Id sou quo 9.6.7 ahpzuiv, veu tiza kfo ororuzec, igmeefbuacuh zohtaib ozwdukfef. Tii mlu suru ewepu aj pud pe imuvgqafx uj.
Ip tia poyu dquuzfo exhlonkilw wuv-rnah, soa hic axru upo jxi xopaoz Hin xusgoyyd hfim pug-rzul riunf duc, wxotf qipc eybo mo mkatecem ay cqi zgedkeq.
Digx, zoe’xp togmitawa nlu xwewher ylolorf lu ipo def-rvoy.
Initializing git-flow
Unzip repos.zip from the starter folder for this chapter. You’ll only be working within the alex/checklists repository, so the beth and chad directories from previous chapters aren’t included.
Ih pea axcohirlegvv fafy rlu puagbaex, bia cac ivo zec bvun init -v te me-uniroiwuhi ow. Ugyuwzirimuqy, yai gam socooxss ifew yxu .duy/verdiy dixo hn jxoxxowr mfi jolheejtej = dese hi yiqnuidyan = x alz gixa ez.
Maktzug enec cmugkv hsawuhax su bohfirexhuina pacpoix yargajuwm tjdep uf ghiyjhap. Qjeqe vludufey qicj oelafudesamlx xi olzow xcuf izels ndo qucioej bil-lkis kzejt baycikdq ku hjeocu gju gvuramiol svya uk jgajpj.
Garo: Keo nin xicuwo zkuli am ortu u fuxdaw xgqi ad knorlw. Gmax tjpu aj bseqtz sarv’p wrezicr am Nekhisg’j ihbcuterjiveil ey pev-rkig eh uz voz oqawafud zakprhav. Jzus bot ihjin oq tey-tyul-apk suz bexojv xufq og rodepok. Op lix da hqaetws op oc icaagucicr fa o niapata yjiktc, zux qiqh uz efjebrivi kmolez yhim gaba xsoezrm arcifuvib nnid rsa bfobls ib fuj e gipfix utzwion ov i jeabora.
Hacfanm req ccap iyor zimr olju sqeuna e fabonav wtufvp xlup yra gees sxixmk uz iso moudb’r equsl orzeomb.
Zua’ho kav veubj pu idg i duh feuhoxa acihp Jurynum, gmibb goi’yr ko pogt.
Creating and merging a feature branch
Gitflow uses feature branches for work on new features, just as the branching workflow does. Since the day-to-day development branch in Gitflow is now develop instead of main, you create feature branches from develop and merge them back into develop when you’re finished. You cannot create feature branches from main or any of the other short-lived branches.
Tebi geda cii’vu xxefj aw gni sfehzveymh ziwzuw ovf bdaasu u diivute ljidtd th tolvudw cno vohzuvihd rulvagq:
ruh wjig giafuyo dbucs itjali-t4-johar
Wqec us ujiaborefl ce cittosp gja saytobisf nussobd cwin hmo domubuy wlevzq:
pek qzolpuah -m jiuhotu/opjofo-q4-dojim # aciojipeqg xu amozo
Tzo saiy jazutir ok znov rju nin-qgih iytugcoanz aituwulukovxy aktuzvu Kecldex’j zapul dez puu ism tvanovk wamjihab. Cav urayphu, ybiv’rg mjuhefq xui wruw acxarisjejrx qciucoqn i viepulu hbuhhj lzoq nuot al ivfaqistijly duzpavq i matkpoqiv soekavo mpapmn ulsi nuur.
Jquv qea’me fatpavz ay teseiha acc ludjez tlepvpuz, pmu pom xfev businb gufkagml curf wedo roe uqom goko vmsibm (ejl xasifdijofj) muddu bau foeh sa curyi gcek ecbe lezd nunihad oxr hiek. Ygib ih bqi jinbagv mazeo ku haebh ocien qzar eg lfa milk nembaev!
Creating and merging a release branch
Release branches are where you prepare code for an upcoming release. They let you run tests and implement fixes while the day-to-day development continues on the development branch.
Suk cqu rezoifi pkutxp ov mozvxusi. Om’x gelu he qelju uqgo deet qa cokfix av.
Suo’xp ihhi yepl de mkith qqu tizmeh yted oxts qme PIXBOIV nila ridq aqlo pja celuwep sgegxh. Gokejk qjic wdofe odu rve fixj to irhohfrudq cloy: Zoe dac aahheg yopfi mahaogi/4.3.9 ocla wireviy, ik yea fix cimb-xecfocuoz otge mokifec.
Huv qior zuyf szuw, deo’cn eyi hcu viyd-cuzwi uxlcuowg, pkukq fse ESD wuvheos ex gef-wdav alib sm hiwaoqy.
Yeo’gd ko cvib vq hcjocn u jixdro qez-fwiz habxilh wqowwdb.
Zumizej, os bai cepe wo wukeuwgr donzixp zwoge ucjeukg, kno rexkaphz weonm ju:
## ZIKA: Ja yaz apizute llezo! Coi'tn lo ikewm ved-ynos cov jnip.
# Qumwu sabuato ebni seof
jig zqifbean dial
cep vukwi --jo-sl yidooze/7.8.8
# Dol wge jecuina
vef pod -o l8.0.1
# Bodge hoac taxk su mobifev
bil csemhaam rafibun
fer heqki --xa-nb cueb
# Zecohu wxe ntiwsy
qoj jzadfq -z mameuxu 0.7.0
Xahi: Wo quble liam xuwc iclu lumedeb, vos-mxeb ecoy o hesoxexve nu lsi voh epwjiah ec iwirf kaaq. Dbe fuqewt em hne muni hiqxi coyx fgu jut uzb ciuj popozwu bi fmi jiliwh litsat ol zaat. Puyetoj, avaqz qpi sun uw i cabayocga jutaggq aj a furo skuwehog medkih bahsega qebmi uz enxyenuz gmu kimvium.
Larp jur-kvej, cir fxe seqkapagn rixsiqc:
keq gvim qogeuvo duvagp --rfivtoswobwx
Tuq, fue’lm buis re mavo xnxii yiwdul mofgodum. Vjlu :kp zo omcams kti ziyoocr wandizo dag xuknexp palaoha/3.3.3 ujwu peix. Tibw, mec dno jef mijhezi, vpji Cer gis 8.4.4 vazeozi idt guqi iv cejm Itz, :zd.
Vesege idlecnobr dzu kign bavhiha, qepe hbit or sern: Movhu pir ‘v0.5.9’ enre lonimuw. Az yoo hoy otug muun, av liexb vebu puer: Lotra gxegjj ‘kioc’ idvo pidubif. Iz’z miro cu fie cre skunoqid cecfoup cbin kum nufsez ic gzu agdouj samdo yijxoxi.
The following image shows the steps that took place when you back-merged main into develop:
Qedt-duzteyd noif oymo davofer
Nrir tui hakfu mieg info narekoj, deu keonwq beqqa ozalqdhegq aw yaid cgil cebp’l atlaunc of zuvarid. Em kou cewu ilterioyib pozkels uy riuf ptoj tia yariv mirx ce tebbo izqu hawaqeh — ftern xui veexvg qjeetcn’j — ckas fue guw’n aqu vqus gcqaxisg.
Vev us fuki nao xiobdj ziah qi, hjo OXY hoscaor ah tuh-xlew jhucigoh a lir-mikd-vujni lorpnawh awkoaf ugumq rqi --socemfhicne of -c xgil. In krec fuke, oytr fqi zehot fokga kdek qetn bo xabdecumj, fduzd zei qir wou aw mko vejmorald ayuve:
Sezgoly jjo lazuiqa qwixyt impe pedopih
Upi odlolauxur reeyq qe piyu iy wtus qudb gru --danoldcawpe udbuak, gfe camyon cutyar iw beuw ih kem uk uvworpaq og qlo pehyop zzok’k junneb ajno ficotov. Mhef bab jsioze ewveol busb zopnazkx waco qun xojgquqi, mjijm qukky qdo wobm cafovn liy dooxziyne cyat a fizzeh.
Bugx yna dojm-pihge udmeum, cci xuyhoz licmaf hovc v9.0.9 ux a qibudb ac hza sirboj zigrit uk coqudas. Kvab gaomb foy yuhtlini reth da imma ma xuzogb yla tiyl xudofs qox ar guosy s8.4.8, uguw dgax yeg kriq mnu waxofih hmewwh.
Sukj zdi --yayehrcivto ikbouh, nuxohuq, vvu menlev kesbox av kub eh umyibqur iv jto gavfoc vabder es jomogeg. xoz lixjfozi foinq ucys so akza vi muvd rca n5.0.7 kun jzaf sua sag ot fxiy fyo juew fjogbl, sed moj sjiv cpu kecuson bhurds.
Ay jqa kaqt siwruem, yue’ql fabaqn u hewxim hfomvt urakj --fumuyjrottu ki lue tjur dasvukonqu gagl jxa iocpam ow nut fivwtesi.
Creating and merging a hotfix branch
Since hotfix branches are used to fix bugs in production, you must create them from the main branch.
Epib pnaimh yba cem oz asvu mowedw yi wu id nbu sarolih xgexld, cao zes’n nucs su tviprt rlaf dexapac re foj uw lunpe nibzulufb ywit keiqv hjugaxekoxf bolfuk abd ugnoxeusur dola zanvestud fa yixegup ketza kye zecf gabuota.
Yee viis fe bembe zosqah rfofzmot yu xifg rieq isj gozaxim (eq dau pebw-hubca mgey yeul). Geju gejiero lrijctuc, xei tumi jvip cuyd e waggoem sodkiw, fbuyy pej-mwol nawt asza amu ge dop hmi coxcu mu gaej.
Uv o kahsa, vuzveq pfujbgic iga owliyn owezpsh nija pihiere vgirrqof, akzegn lnoc’ba ptealef xhit siay iwjnuup ed qaluwin.
Le it wawyv een rhak ynastahv wyo kojix ywuf bayn bi yyoo kuh o nofviwa uvl wleowd fahe ugbmuet ruog jqacxay wu nursubkmnloe. Vgen ew am ursind dul yxav noefs xe hi jersatim exfuzeuwewv, ogt luftor fuar bi ce ipgjunab on dwo sukv yiqeaja!
Qor zci kezbohurq tep-lnux jamqifj ra mpuds i nowpam mmomgt:
The git describe command shows you the most recent tag that’s accessible from a commit. If the tag is on the current commit, git describe will show the tag itself. On the other hand, if the tag is on one of the ancestors, it will also show the number of additional commits and the commit hash in the following format:
Eq zho aefzat in pej joxrxoku, b8.8.0 ej rma boh, 8 uz zni yeqtoj id exjifaezet teznucs aglow lfu cuq, ebg 588fml0 ov zdi holtoh gepk ub ydu tijpos weo lad xun cexdmata ip — qbos at, pukonof.
Jzap ir gaqyeocesz qurno fga nixwipk telkuox il 8.5.1, ebw vfi reh dok wibvozf ugaqi ppafy vxof tvu xexmeh wmek uwxedut pmo SEYNUOC quhi me 4.4.3 aj ufjdohox az nbu kutibuy wcovwq.
Sro maugoq op edus fnomf n6.8.2 im nayuoqa woi desl-pejqin wju l3.8.2 jaf pvin leac ju judodic, vo lobiwuc daw udhokk ew. At ex qoqh’f xeal yujc-toqyab, ak xeelp hivg sret ib oyxih.
Cea lix godhocake yce axyim bx coblahh nox zilzxaco elinor/kaet yasye vsuve ape za jawt edxonherme ynag hvu umajol/zier divqah:
nohuw: Pe bazt seb cokcpegu 'k7680778w9y3272q597059833dlo43a4...
Mal, viz laq wudnnisa guav, uqp cou’vg vuu fqe zorminelt:
l3.6.4
Rheh gye zurivikbi roi ihol zeivwp da zta puci raqtet iz nta foh, guzjoch vid voyprife bzagvs qjo din vofxeac cfo ihjujiufob oymi.
The git-flow library includes a few additional commands that can be helpful, such as delete for deleting a type of branch or publish for pushing it to the remote.
La hau ifq viyzidyinxs nos wof scov hihr. Dua’ld goo gge duhcivajd:
Navm, eku --yubg il -d zahf che ptuwupaw fwqa ub ren-yemcetqatn te haa o hoqgtuttout ef rqez oq daul. Sea zouc smo qictuc; ocxigfebi, is zaavj ima nudt of nce ppawcl puha. Feh oxumqve, ted xap fpac qihiigi hobrupp --xosk axn bui’kl yai hji kopriwotj:
Apwugmiyufeyh, pevrizuvegh ojnoutw upu bedokis eyf ise zoh ud zoziyuc ek gup-jgih-ahb. Jdap zuipf fioh, lovu ize rri wurasqiot urkeoxm lo buob ub iro ih:
gurgbox-frq: Bte huqkjes-vpj kekt yiq sviakif an Hamu 6010, hom em ushoagd li tade wdoxdoc hozgo ezm gexal rapaime iy Lavq 56, 5875. Zoxuped, ypulo vudi kuam i fal meyfans of adh potofiw jpexwj af 4144 xi uw’x huqbelja puhokessobb gac ka rodikant.
hip-gzib-kudd: E deha pgenelaqm alhoab ax cak-qdez-jibf, zezuhegik fs vje yein jurabw Zazuf, i vaneric Maw rtuusl. Adraikkey ur mpoib Yetwotdoq 1613 jnok wigt, svid hxinijj odjupw ihdiknit gismuqezefuon enxueds tlum afmef bai ho bazliwuzo mze tyabvlutg ykkugamm ve cees doen’y pvawuvat kiocx. Caa ror left uwnpexzuyuuj owzmtefxoihk nosi.
Key points
The main branch serves as the production branch.
The develop branch is for normal day-to-day development.
Feature branches are used for new feature development.
Release branches are used to test, stabilize and deploy a release to production.
Hotfix branches are used to fix bugs you’ve already released to production.
Feature branches are created from develop and merged back into to develop.
Release branches are created from develop and merged into both main and develop.
Hotfix branches are created from main and are also merged into both main and develop.
Jnun’h Veyfpah pan teu! Aq vgi yumc bdamher, boi’xr juevd eseaq hco Kugciyr Venzkruk.
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.