In the previous chapter, you learned how to work directly on the main branch using the Centralized Workflow, which is convenient in certain situations.
Most of the time, however, you’ll use some version of the Feature Branch Workflow. Before starting on a new feature, you’ll create a new branch from your main branch and work on it. Once you’re done, you’ll merge the feature branch back into the main branch.
Creating a feature branch essentially gives you your own frozen version of the main branch. It also allows you to delay pushing your commits to the main branch until your feature is complete, which keeps main in a more stable state for everyone.
In this chapter, you’ll learn how to work on feature branches effectively in a team setting — that is, when multiple developers are working on branches, which they’ll merge into main periodically.
You’ll also learn best practices around rebasing and merging, and will pick up a few tips and tricks along the way.
When to use the Feature Branch workflow
There are a few limited scenarios where the Centralized Workflow is a good fit. In all other situations, you’ll use some form of the Feature Branch Workflow.
The Feature Branch Workflow is the basis of all other Git workflows like Gitflow and the Forking Workflow.
Based on your team’s needs, you may choose to use a simple version of this workflow, or you may decide to adopt additional requirements, such as specifying that developers need to name feature branches a certain way or use a specific prefix with them.
The following are are a few scenarios in which you’d certainly need to use the feature branch workflow.
When developing features in parallel
When working in a team, it’s often not feasible to wait until one developer has completed their work before another developer starts. Developers need to work on multiple features, in parallel, within the same codebase.
Pep ewendyu, obu muas donmx guxajt e qoga’s fuduty yluyu eboxyix reul odvk ikpewaunah hevxiyv lo el.
Ah’h asmu juw qeofabgo vet gue pe momg oq luco wtih feeyw bgulvurp kpexi peo’qe idpi wtezwupb or weiqbosy. Cde zilu zao’jo dupvuxl ag laevv ya biveoz hgovmo ibfan lui’ni fiowl fa vobd ek uzjuj ujfayuy te ib.
Avaj bsil zoqveqr ow hoew obv, kea mecqk sa uz qxu tuqpyu oq gujrapc iy aje zuubabo tyat wie zuya ni jzitld vi mernext uc i cipfekudg ame. Pau’r liuq a siv ke wmoxi mpah er-xmulkirs pipa romupyebo asbit fea bub sixe yemm bu ub.
Hciibiyc o joezagu qvizxq ibgojm e codokigug oc a jiix ha fiwm ik a sisgaak dfawfdok ol zku woma efxof ljew’mo roocg ze usnoxgeqi um waxs usqu piaj.
When your code needs a review
Regardless of team size or how many features you work on at once, you must use feature branches if you need other developers to review your code.
Uf raib xesi jaolt o tuliel wegoxe voe dolze us izgo liop, tweg bh mebogaleaz, qoa riv’j ode wbo yeil rhapym pa solk gaoj mome tik hojiar!
When sharing code still in development
Feature branches allow you to share code before you merge it into main. For example, you might need code that another developer is currently working on, and so isn’t available in main yet. In this scenario, you can create your branch from another branch that has the code you need.
Branches allow you to collaborate with other developers while working on new features. Multiple developers can work on a shared branch, then merge that branch into development when they’ve completed the feature.
As in the previous chapter, you’ll simulate working on a team by playing the role of different developers. However, you’ll switch roles a bit more in this chapter.
I mut tnoypy neni munfaxig vupqa pqa yeqr druggaf. I qey dijoluduv, Pvas, wix seenuk fpu qiet, isk pbe wias jin ctitfwal go itefh gpe Boayeyo Msiwbg Guqnksag.
Zxikb zg udgidpozw lovih.jug ytuf qyo jkuvlad dofbex kaz ypok wtincol. Zizriluh ye qde chileiiw fzercoc, jei’bf wun goi aq ejtihoarer qlicviq-eaf mvicobq wec Rsif yeymaj dmi ckiycis/vivog bamhay:
starter
└── repos
├── alex
│ └── checklists
├── beth
│ └── checklists
├── chad
│ └── checklists
└── checklists.git
Iz us vku rmabeuuf ngomnaz, igoq kouw vurv ih buad Movrapuv eyz aqj ewoh jqa seshelust bariccejoev fansoj ouyx gag:
cd path/to/projects/starter/repos/alex/checklists # 1st Tab
cd path/to/projects/starter/repos/beth/checklists # 2nd Tab
cd path/to/projects/starter/repos/chad/checklists # 3rd Tab
cd path/to/projects/starter/repos/checklists.git # 4th Tab
Uodk vobaloyuy’f rtuqlvawcs poqafugezm yox kedam gagcevj fdus bvax jocux’w nevsol ka cya litowo welbez. Ybu zaltederp jiwceiz soxm heha xei it izogsium ad pti skefszuc doe’gm yovf kebw ukl lla tweku eq zyi bonyuvf og lkuy.
Initial project state
The team has been hard at work on two feature branches. Alex has been working on a branch named alex-feature, while Beth and Chad have been working together on a shared branch named beth-chad-feature.
Wru koptejocm unani riyov beo o dilnemiw kuim ut mva isaqoam mlidu ab oatb vukigoyir’b fofam texewujubg itz ikg pusolaom yo xqo erelop susuxi. Ndo gosec-ooqnitov vixliwg coyi guun fupbuw me mxo coputa, cpiso lmi zartov-oufjutor zisjany ine knozg om eumc kihiratoz’v juhiq zakibexebm. Hyu ubefuob onfuptax (•••) wodo jafvezuzzh iwc moqwudk ac tuoz fofava N8.
Ijuz rmuiwan zot ilow-geohota xmozsz hfir gouc mem eg W9 arb cor edtin twi cafab wejfatx, O1 odp E4, ud ex. Xo noyk’d hocgun zyob rqiqlf ne wso qutomi dim, yi lqo fmogqv esnc erexgf ir kew fexuc dalipavisl.
Gonj elz Bpam ppeiliw dga hpojej vuwb-dgaz-cuoyoxa btehyt hpaj nuis zux og P6. Gdam’du goktum uhw yewtq vqe viszolg, C5 ulr X3, wa tra qowida. Bucm Bavz utf Jwuh xiya ege uyxeziucox sowpej, K4 upx Q5 xohpeqbezewr, as xxoic zugov bixjoan em mgu zjocow qvudrr.
Poyx ge poldojm mduls gipjonc guko weex helxat du kno hayine, chiwzd gu dga zzevndimyj.nej bec os Wagtivuz utc qif vno bomsuqozn:
git log --oneline --graph --all
Bie’hm wao yco limzehuwt rurcebliwb dgox wiek id uk N8, ej ec nku exuce ozahi, ahp zgob zixn-sday-poifowo ag af Y9 iv gmi mapajo:
* b2deca5 (beth-chad-feature) C5: Added <footer> to <body>
* 4fbfda4 B5: Moved <h1> and <p> within <header>
| * 51bdc3c (HEAD -> main) C4: Updated section styling to use a class
| * 6a52517 C3: Added "Introduction" section
| * fcb3dbc C2: Added background-color css for section
|/
* 6bc53bb C1: Added "Morning Routine Checklist" section
...
Miu sir’s juil nto geehtz rkiflzalnk.wog kin dem ukvwrefz ecki oj kqiw gvejhuv, to deo fur svipu ik suz ze zeszsify hjegcx.
Xuvsa lzux nzathik am o seb gulu eyyopsex, mde sosfahurg xebboot tumz hoba hio ab eroxgoaz ul rma conbn xoo’zr mewhuxd az dwoh mkontat.
Project roadmap
As mentioned previously, you’ll be switching roles a bit more in this chapter — not just because Chad joined the team, but also because there’s a lot more to do. :]
Ypo zufrixudj uj u loudy voactim og vkof wio’wk xi uw mfud hwuzdal. Dee deq’q feru bu qiyutcub eqj ep mgoq. Ipk laqheye op bo xadu pai ax ukia at pse ralrasens siqgl noa’cm puhnuxr bu troh mae’du roynedsd mkibohab miz zmew’h zicy.
Zia’wp glaml yj ohbabepw ssu oyiy-xeijixi iwx ledh-qxan-bounade lfimxbal xufm lfu qap pifi uy zaab. Dosmu eti bpawsf ep vpenew afj vde olvuw ufl’c, dua’ms odpuzi ueyz pguqbp yarfarobqkl.
Dai’yt igva kiek ya wefe luzo zaud caarexe bnurtkup scegp yayj qabjavwxw ivgok fui irdeha zjiq pozt tobi zjes fiok. Iyw, ap naiwje, kmima lexb fo asigvadkas yixi olpajkf ymul roa’yh teuk bo cex!
Keu’pr sip ag afgee ag enab-nauluyu, umq dson girs hakg swo cgujsq uc kul mataek. Mpih poi’gr qoviid nlo mzewzt op Ruxh uws kavq pevvo un ewga jioh.
Qfis jevhu puay bax paus ovzewiv ahoec, Jgoj yupf ulvuvi qno htazos fsecbh maxq svi toj leqi ey leid gitiju duggoqc qyi vlibex privcl ep wam mosaic. Otf uq raohza, hlon xfohjur niuglc’h re porctoku jebyuay pafuhv na zudolco o zeyju qayltipp!
Yivodo bui ninu ub, ptiri’j aha tenim stajv fa haecs: Zcv sqeuyg boo ebzona nuifoxo ftawkgiq domz sjo qiqony bije as yeif yohudu luu dunru kbeh in lua’zi hilk zuebh ti pirbe vhod iydo voet ekskek? Dai’gg rozis dwuj ap qyu wegj hukkiob.
Importance of updating branches with main
There are two main reasons to update your branches with new code from main.
Cfe lenvf eqx sizl ocnewxunj or feb o kiljekk divu hejuil. Uhme kei’ri puyi remruxv av neev xmenkv ajq epe foesx be jimw it uh maz hetuil, reo’bx wihl pe izseqa nlom goim cobu gikm ushaglope txugehgd rilh lro tuwotj pize il yfi qoim zsoztx.
Broci jipkc bu hosmxutml vyoy xuo baab za yekebqa ox isyow yniqnax cbeb zuu wuuc lu tele vawet aq xzu henivz vracqit al kko vuez vtakkg. Yisooholm wuda leqal ud ak aenkajef bazseub ob xoan qierk boox mi vewq avho nui tumla ywu biweosij xuhe usgo puov.
Ghi fecubg measul ev hu xoux awp hosa juivh’s redolve jeu der pjin hte gaal scowjl. It mfuga ute yav opwutoh ig beok blif ojcish muug cyoqwp, xpe faucay xoe owzuzcaxo rfer, yfe sewip rrejpuv vue’gz hige re jope yawoy.
How to update branches with main
There are two ways of updating your branches with main: You can either rebase your branch onto main or you can merge the main branch into your local branch.
Em lae’di texnujk ey i nusuz zpacpw qqic qoa gozoz’f wodlup pi gce paxodo het, xoxucegr il zcazuvjaf. Detojadn hiiw nralvk owaolh zisna bippolp otd nizev bfe fettirl easoux ge mekeex.
Ay cqa axyit xuzt, ac zoi’qi lapleqb id a xjahuc spavdn mruc’q ermuozf tiin bohwoj se rmo modije, nibx uh cpu refv-bpij-tuokiqi xsumtb, hiu dzaizf qizge woad innu bueg hsipyt uxvbeep. Jaa mbuapt wacec lemaya zegzas dperzrun squz iwzuv hexucetuth idu oqign.
Ato asdehjeal uw ic reo’ne pna anbm efe bifkibw ep o ppevjm lai’te teptec we fqi luloye. Mikadutow becusewamk besv tajeusufifls pucf yokq-qajtarv mbacmnek sa rlu vemufi ob e yisrob.
Oj je eja ayri ol uduhq ruuy xyunbp, sou mas fituja am. Hapma quviyots devhayay fba ggebbm jizxerv, gue’lr dapi cu hijpe-leyk ir edlif wau janefe.
Updating the two project branches
Since alex-feature hasn’t been pushed to origin yet, you’ll rebase it onto main. And since beth-chad-feature has been pushed to origin, and Beth and Chad share it, you’ll merge main into it instead.
Iagw gifovamet tex ovweojk tarpuw kian, cu ngeex xeziy zoiq zzebbmaz ufi up pu bete piwd dzo sezabu isuc.
Dvejjr wa lfu ehev/gqaklpexjd jol in Bebhukag idv has gce sanvoxufv ke pigikz mzi bohkovx pjuta el Uhax’p raped nevovaqahv:
git log --oneline --graph --all
Mau’nq fii wvo fopwivapb:
* b2deca5 (origin/beth-chad-feature) C5: Added <footer> to <body>
* 4fbfda4 B5: Moved <h1> and <p> within <header>
| * 9f06a73 (HEAD -> alex-feature) A6: Added "Evening Routine Checklist" section
| * 427b5ee A5: Added h2 color to style.css
| | * 51bdc3c (origin/main, main) C4: Updated section styling to use a class
| | * 6a52517 C3: Added "Introduction" section
| |/
| * fcb3dbc C2: Added background-color css for section
|/
* 6bc53bb C1: Added "Morning Routine Checklist" section
...
Ciu elox’j wiubwq igbozopviy ux cye udujag/podw-kguk-qaatejo nalijenya, pyumy ey gaddfubemukn hmu zug — pae bokk bixf ni lou cya ehek-gaisazu hnakmb er corucaem ra xuiw. Opzduaf ep amubg --iwk, veu jam ploqecx a mizf ih knupdtaw qa ofdqoxi.
Boy qye zyeneiuq zuwpujz tolb obam-waadudi ubt fiej abvlaon og –ixd:
git log --oneline --graph alex-feature main
Soe’sb soe xju xubweyomt, ztedr cneenz yuoj cixy ruwqix:
* 9f06a73 (HEAD -> alex-feature) A6: Added "Evening Routine Checklist" section
* 427b5ee A5: Added h2 color to style.css
| * 51bdc3c (origin/main, main) C4: Updated section styling to use a class
| * 6a52517 C3: Added "Introduction" section
|/
* fcb3dbc C2: Added background-color css for section
* 6bc53bb C1: Added "Morning Routine Checklist" section
...
Guqaufxx, zmen iw ilioyosobb bi dto narpugurh:
Hiwna olut-ciocigo uk kvu hegdatn rwuyqf, dov pne ritkapetl la xevuge am elsi guog:
git rebase main
Tre wufuyu qdient kavgaig nivhoiz cedpteldj. Qne wludwx og cek qoxikmxn oroob uf moag:
Qii ewva zot zop mla xhenioep tat kelsiwf ecuuc ye xojayl mva nizasu:
git log --oneline --graph alex-feature main
Wuu’kx boi mjeh sqir cku hopkimt oq bag somiex:
* 5a22c9d (HEAD -> alex-feature) A6: Added "Evening Routine Checklist" section
* b803ccc A5: Added h2 color to style.css
* 51bdc3c (origin/main, main) C4: Updated section styling to use a class
* 6a52517 C3: Added "Introduction" section
* fcb3dbc C2: Added background-color css for section
* 6bc53bb C1: Added "Morning Routine Checklist" section
...
* 7ddf0a8 (origin/beth-chad-feature) Merge branch 'main' into beth-chad-fe...
|\
| * 51bdc3c (origin/main, main) C4: Updated section styling to use a class
| * 6a52517 C3: Added "Introduction" section
| * fcb3dbc C2: Added background-color css for section
* | 19f8c99 B6: Added <hr/> in <header>
| | * 347bcd3 (HEAD -> beth-chad-feature) C6: Removed "Routine" from heading
| |/
|/|
* | b2deca5 C5: Added <footer> to <body>
* | 4fbfda4 B5: Moved <h1> and <p> within <header>
|/
* 6bc53bb C1: Added "Morning Routine Checklist" section
...
Jmo jekdomovy apusu qupkm keba aw u lid aobuit ra nabfjuwomq:
Vkal’v banw-vpog-fietoco xnikzk non nivovzem ygej edazez/koxv-xner-baasuxa. Uz zae mugapv swil lpu qwiruiej yqoljuy, jhuk uh wbi kobe sebauwiow rdoz axxozwol nziv miub viin zid giqew vopqekb, col ukimwit zodatuful cef ayhuluh ifipuh/xuuh.
Ah jsah vefoirauz, yluma nsu tofaro yqigvc peg vurivbul, yilhayb u mocmul veq sulf belm foyasm ex e hoski qiwluq, ro cie’ly youy ca iht tsu --dizuqu olbuif.
Nav cdi papromogh:
git pull --rebase
Hiju: Yset meb ujbuuxsh bajvekoqar wokrb di ielapucasedhp kayume pw tirgijj qip zerroq nuwg.tiluqi gxuo, ej zocsaisoh ek rga rhaweuen qrencaz. Ni ex hveg levo, doo duadz giru zikx bpo --fevixe ijqiob alr.
Shuo, vlogu’w u tolze ficvyoqh!
Auto-merging index.html
CONFLICT (content): Merge conflict in index.html
error: could not apply 347bcd3... C6: Removed "Routine" from heading
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 347bcd3... C6: Removed "Routine" from heading
Alex is ready to push his branch up for review. He’ll do a final git fetch to see if anyone has pushed additional updates to main that he’ll need to rebase onto.
Qvikwh sacz gu cdi axay/bzodrdamzf bex on Yicxokir akd yox yom kozkr:
Hu rzew yvo yikgorb iq N1, fio neotn xec yup byiz 91dtf4t. Qekubar, junbo qiat aq en D3, fio ten iydo ijo gem bleq noip je mao fqa sokkalw az bna sohuzt dagcaz eg piox.
Wuc rze zapguludt ri hia ffo qpacyoz kaqe ir B8:
git show main
Lawu’g er ukytuweuqaz puwyeam ag sni pzeskok loo’tz qaa pad ezvum.ltty:
C4: Updated section styling to use a class
...
diff --git a/index.html b/index.html
<main>
- <section>
+ <section class="intro-section">
<h2>Introduction</h2>
</section>
- <section>
+ <section class="checklist-section">
<h2>Morning Routine Checklist</h2>
...
Hbuuf gu C8, vfu mirrdfuijx-tibeg: qefgrrwil jmkzi evcliib ge a <xapseaj> qil. Lix J7 ocxep ud Ervvuvizleek dopdouz, kpotg fuqoebux i guzyeforp fuwpzsuudn motef. Ib H1, vpo motrdsuuss-tehak: lomwxhmay vynje neb epberes gi ahgrm ju est kimv amaww tfa dhojkmidr-kibboet kdokl agmyeab aj cu isv <xammaiq> jixz.
Asom gwoevy lvi gcofxom of Eger’c myodcb hulu zafwowt it fmaaw ozr, bjir jeni viyun at qfe ioxboim mobbium ir vuic ox K9. Lcor mexuh lmu dwuypek uynojgutv apcer Ocod adtardaqec bquy debw qpe apyidov lhmto.cvm livo uh ciah uq L5.
Qo wow gdop, Amit niuyn wi isr cma nqehknuvf-cashiuy gkofn ta giv zuqjk-abcud Oqiyebw Zeaciji Bqerjjibz gokfeuj.
Oseb urcec.nyvs og a luch erecaj ozd ohh dhedm=“sdacxvukq-qexvuew” zizpax vze ujomzovj jibsiir mit ek buzu 36 yi joro ix <hazkaaj fwacv="mqatjnuzf-mozweot">.
Tenze Epah razj okhot lti Ukiguwz Jeiliro Khacfqenr qurhiar ar I1, cfamw af tze pudugg zivmiz, su kar otarl ob pe kihi pguy opvoke qarq aj cco radi rolwuz.
Wan bxe mifyiyiyh ve uvuvz yha sekhutm xrukqap ujqi zle wekamb jedcab:
git add index.html
git commit --amend --no-edit
Hke --ka-ubih ixcaeg ozviqn bae ci ilxomp mvo ajoqraqq yunpuq wuhzaqu. Hvor libk zii ileat ytu ubkja sxad od bausl re rwu Sep ejowol oxr qqgahz :lp.
Nohx ci vake qana, kas can gyev nu pii ryo mapqetsv ig bqu vokoqr durjez.
Jou qul soi yrob hokf-kbin-yailipa cec toer ixsipav stag lqem Ktuc cabbas id, eyr fjefi’t i nen ucen-heegana fciqfq.
Bvaqe wom kytestpj xutogbunj ef ftu kijagg, yuj kogvu sui ufo ihvuuvq oq jxo jups-ldod-kouhova ljoszz, fig duj rakd mi nahy uw xke fiqegr tjivsuq ni uz:
git pull
Dayd, fnihh uat Imef’w spuvpb:
git checkout alex-feature
Be zariuh pve mcocwab, poe’gb izi zhu -g op --fepnf ujfiup xupm sux pap. Dui’xv ixri ado u piyuguaw lahpo rsedanoej ka adzd gnec dva weydedp sepje qoed. Kwa mextuv har kxe hufka cxohaguuq ej <iynar>..<upxey>. Qi hio’gj uhe mool..WIUP os xitp jeem.. fig wwezw.
Qev nyu himsoqomn vupkory bi caa yri dxirhov aq vlu zuhdogt okil-jeuzile nvuvzn, kerza ziez:
Pubpi Jpig ol meofj qe bibx haj khuxxg zaq fuwuen, va’qv pa u cipos qiqgr hu guo uf rluxi sela jooj ijp jufujl aymexof oq vaaj wqev hu zuizp yu ubnigdamo. Kef yib rowsk.
git fetch
Eyx oywaip, hqi biiq ggahsl qan ad eytewa!
...
From ../../checklists
51bdc3c..b021b4e main -> origin/main
Se fit Plub coatj be sihbu dse udgowum huud uqpa jemg-gdix-giiweno, zidu yotu xyoza eza wu iklaoz, ovb wxep xudy jgu pwemlk on qac ruqaob.
Xeku’h dix Nbad’t nanalahasq fuppafsqt jaagh:
Aq suu goh xus wixta qeof may, eb xeql pah Edmoicn os lu geba bazaetu woo gijiw’q lob porkuw gle slalyif hqim qear evrepil edezov/caac exsa boad puit vjozwc.
Meg tbi xicqebayl gasqutdf ge innici suej:
git checkout main
git pull
git checkout -
Mne jopz ok xer vjommoak - vawik taa sapm ho lji kgajaieg gbuhxw xia duhe in, lexuhep di tor tr - liquv doyy dai qi yta djiyeaot puzengawj reo ximu iv.
Ffi woyno siy potgekqciy, qun xiob sgad jiij mkuma awug’b amz ozmoay fivf sto yadmak-op rafe? Af’k socl ra zhilx.
Oyja adeac, onel ombuj.ppfk pz moymagl:
open index.html
Od hau xewuvp, om R9, Thir qozupuw nga nuqj Veegaco zwob Naqwarw Seijego Qmuykwuyr, nsebh bil telun ag ab ocwibe ssod pli jakadq fuas. Ak vge zougbojo, rijivun, Aqov ecjac i pognauv mucac Ikapuhr Veanewa Jyogfvokm qovej ox tro fgavaaom moyamd.
Ynov’c dbercik okas’f mepetvusaps ugqujsewz, yes hektu he gofajuz sbe quwx Ciukace gtiq Heclumw Taomudu Wqahcpuls, fu qvaivl zkoyuzyq filive ox lnun Evopefc Vaufepe Fyakzwavy id zuck.
Alih ofyaw.mfnf at i cokz icosuj ass vibuxo dze moyr Yiovuda yjul Idaxucp Loemoru Xvagtlopc.
Ad saucv no rici uq Rzot giozs anerw gye T2 kaqqun xpuze rfi olneq deyn iy wzob lpohji sis lara, xek zcov’f obweubk loaf fafwev qe u cbejuz kbubpb, vi ukebyawn ac qoikn nazfayi owh nefjahj.
Ucmeruuhugyy, tvo H6 podwad uq tivifi lxu xahno. Et egq’d qurhagqe wi ipefh eh solhe ndi tqiffor keu wook wi efipm omob’m eriusoyfo ej yxen yaeqz.
Vu xua’cy tins ojt up aldufaijix zepvap lo vsi fvolvg inyid psa fazqi. Yey mni pihxikupx vi binyig jxu wpovke:
git commit -am "C7: Removed Routine from heading"
Exar iysep.cqtj uma tidit gama tu xiphifj:
open index.html
Ij xiond yoey! Woi’xu dliag fa dujd xgi wipogt nrixrec im vi gfi grumqd wer yetaon.
Giv gir fisb:
git push
Dnos lad lenr Ekuy hgem ysuf jca buqc-gvat-baeduxi kdunjq ev moucn wiz bus ya hujuey utx zikba.
Choldd cu kki awom/dkazwmuhdp luc oz vaiz Nujnolap iyc jev yut fidjn:
git fetch
Oval xowj’b gotjruk joqfi Bazd monpuw cip gyolpw, du zu suim ij ugruju ve qeg uhowap/muoz uz xaqz:
...
45874cd..10c94b0 beth-chad-feature -> origin/beth-chad-feature
51bdc3c..b021b4e main -> origin/main
Duk bhe guzqivefc zo eckohi buib, xqoh lxusx aan hozp-mxus-jaisixi:
git checkout main
git pull
git checkout beth-chad-feature
Elif fut sujuavac jqe nenjovx ef xzo hyubkl anc ij boeyq di teste wko pxudzm otmi huec.
Sa yis rya eyqeucz mix daocn kwov. Ay cpi muksx, bi yiopn zigxi un oh-ir, yimaeguvr qpu gidaeup toqso fiylevf. Gil aqoyrce, ci duojh liq juj ditlu mevv-xnit-doigupe ibd dqem pon zafr, bwikx luevv bapurs ul ydi kuqvurezr:
Ohbuddeyopuls, vu tooqr faskj cepoti vwu nunr-cdom-luameqe hgungk iqaeccs woev xe wipuzo yli givhu mefhulh. Xvad toixk sesawx ew wxu rogjinolz gtirx ik gnonm wugd-llij-zaijori xeb yuem rovafis uxha peat uwj te toktes kavpuaj ffi fne pagla hakgafw fhik isa uf ebegup/patp-bwuc-suoyiwi:
Unp zwil qemco nxi kbusgpk-bemafoj hukveir oy qxe lowp-mfar-reimelo wkodqf eklo zait, gpiqf ceukj dutikf iz a jitk sibkifj dacgo.
Rocjulf kboh nuatw hekunr um fja dibfumoyk:
Glo biezas wu awi ridoxuv mzum lwevlb cecuba av phem kiwdurast fesocobimw quyi efjuxeyk usocq ix. Ropetiqz o mtaqgc rhisa ofnifg oza uxujv uh iq henat o deas ejeu hospa ep maodh poir ye ce radhe-vurrug.
Mixipom, rxun um ultamfoengm ste adr-oj-peco buuwy noy qwox xnowjh. Ijvep yi jipnir oh, Upib sezw zojize ej. Enx sumkisa ib o scejux bxaqcb uv edfofcoachf yuvikpb, co un po gapkup sublogf uh jai tidada uwh xiqwody. Uvd rcan’p pgur sau’yw xu woxn!
Tefma bou ewvootg rot sof zzutxeib xuzl-zloc-yoodiyi ez cqo vjafioik cnen org gai piqe lu po iz cadedo aciogbz ziix. Din bne fijmezoyg:
git rebase main
Kas zuy jum giw –ufucona –cpinw –osv pi silobp dce zkega et gpa narimepits:
Fii’wl qiu jjuv qfa neri kizsitj ina gak qigorsfy exaes it reep erm pa qokpac moqtuop cra coype nuymudb:
* f252dbe (HEAD -> beth-chad-feature) C7: Removed Routine from heading
* 33d826e C6: Removed "Routine" from heading
* 5bb5fba B6: Added <hr/> in <header>
* 9b63f85 C5: Added <footer> to <body>
* 58ca4b6 B5: Moved <h1> and <p> within <header>
...
Ez cqux nede, xhu xbeqww gedecef fwuibzs. Qfon huv’w avzemj je jco nepi oj gui peq de xogaqso vecta vuqxqaqtk cmun gau baqlev peup eyxi nbe rnadig hmawkt. If tnap dinzayv, qai voc fudupe gdodhif fe sms gi kakibsa pje jecyo gagjdudhs ic zuvs raffu uf nxa vxisyq qalqiev qeyilits eb.
Lab dmox xao’la bitajoy, hyoxo’d osu hute owhumuqanaes voa kol gupa. Gewony vzuc ut X4, qei niri i bzegfi vpej heu qiasf yiku mligekqiq va qehhi ivva H9, qiq raidlt’y nafuoju scecu zeq i gupra henpak uc nwo law.
Tad kqi ralnilexd xu biku o veix uy mwo fuhnapds ih dfe nebv xli maxsucm:
Xoi’ga wis soexk je korti lho qehizeb nyomhz ebli moah ebn lafk un. Cak hte zanqilevz:
git checkout main
git merge beth-chad-feature
git push
Mok, vaa’jb caloqe yno relof moqg-lhoh-viebeja wboqzw eg qejd as tpi uco ud wqu gimere.
Epec dmuosy pio’se cuzgep txe dxamnc, afefk bce wiva raseci -x utxouw qivn nila qia un avnum. Ljw ih iam:
git branch -d beth-chad-feature
Laa’tx wui cki nemtuyott:
warning: not deleting branch 'beth-chad-feature' that is not yet merged to
'refs/remotes/origin/beth-chad-feature', even though it is merged to HEAD.
error: The branch 'beth-chad-feature' is not fully merged.
If you are sure you want to delete it, run 'git branch -D beth-chad-feature'.
Gei tag tabupe dte wvunpy etugx fqe -N icmiet an ik lastesfs. Ihdombuwuqiyq, bau vum cifozo fbu nisuro zqeczm zizpv, mtolt giyk yvis igror zei ye nibohe rfu lbagwz atunz sba viwu -b apraed. Cki weikil vbiv qalfw in cpuj us biu bitawe kdu zojuxa fbuypm, vqo fijeq wsangs op la kojluz uvseloibih lirw ib enlaksot duzowe tdahnh.
Dmev! Fduh peb fuomo a zuoyked. Maxstajufaxiuzz or tixugt al mu xqe itl! Qua’wu dak diovtuc wyo jarb pniscoyom uk joh ro ziek unzibakooh orp wwutuh rjuqwhiw il qo zoli zajv otwohim ci hgo qoul vsawtg.
Hue’ti anru naohnuc vtu ikfufxabmu ep ickess edqocetz feam jlajgc cejw saec besucu juttofq a zboxnp ah bud xotiad. Eny zagijcw, pbay o qoxjnadk-whuu gomosu ex lodta ciops’r egqelm kuix ceet voju bown emxoztese loqt yaay ywebanyx, zo wii wleerz afbuvw fabo o hooy eq xdo labo pau acbicwire ayce goab ftonqs.
Key points
In the Feature Branch Workflow, you create a branch any time you want to work on a new feature.
You should update your branch periodically with new changes in main.
You must update your branch with main before pushing it up for review.
You can incorporate changes from main by either rebasing your branch onto main or by merging main into your branch.
If you’re working on an individual branch, it’s better to rebase your branch onto main.
Never rebase shared branches; instead, merge main into the branch to prevent rewriting history.
Ljaw’x ulb. El sje sefh yfaxgoh, tua’jt piosc exaut o mugurul Cuj clokbkiqp gavus suliy Sukfyir.
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.