Rebasing is often misunderstood, and sometimes feared, but it’s one of the most powerful features of Git. Rebasing effectively lets you rewrite the history of your repository to accomplish some very intricate and advanced merge strategies.
Now, rewriting history sounds somewhat terrifying, but I assure you that you’ll soon find that it has a lot of advantages over merging. You just have to be sure to rebase responsibly.
Why would you rebase?
Rebasing doesn’t seem to make sense when you’re working on a tiny project, but when you scale things up, the advantages of rebasing start to become clear. In a small repository with only a handful of branches and a few hundred commits, it’s easy to make sense of the history of the branching strategy in use.
But when you have a globally-distributed project with dozens or even hundreds of developers, and potentially hundreds of branches, the history graph gets more complicated. It’s especially challenging when you need to use your repository commit history to identify when and how a particular piece of code changed, for example, when you’re troubleshooting a previously-working feature that’s somehow regressed.
Because of Git’s cheap and light commit model, your history might have a lot of branches and their corresponding merge commits. And the longer a repository is around, the more complicated its history is likely to be.
The issue with merge commits becomes more apparent as the number of branches created from a feature branch grows. If you merge 35 branches back to your feature branch, you’ll end up with 35 merge commits in your history on that feature, and they don’t really tell you anything besides, “Hey, you merged something here.”
While that can often be useful, if the development workflow of your team results in fast, furious and short-lived branches, you might benefit from limiting merge commits and rebasing limited-scope changes instead. Rebasing gives you the choice to have a more linear commit history that isn’t cluttered with merge commits.
It’s easier to see rebase in action than it is to talk about it in the abstract, so you’ll walk through some rebase operations in this chapter. You’ll also look at how rebasing can help simplify some common development workflow situations.
What is rebasing?
Rebasing is essentially just replaying a commit or a series of commits from history on top of a different commit in the repository. If you want an easy way to think about it, “rebasing” is really just “replacing” the “base” of a set of commits.
Nimi e teoc oq hva burdekamx hzubuvea: Djo t nezlawm toquze i celxel poihide glodkp, oqy syu f zimsizb jujoze o saqduy zkunsp joe jfaajuy ej azrip jo cisvavw ew aqslona wexurpipf eqrajo rpe diawowo lbiyry, qadjaer uqjiwiwf qoyq uh qwu jaenedo gasazowlakw. Fao’va sequ u fez hoqjuvg ivosm qce rud, ujw tuq eg’x bija za fexca ztu nonc ig gya yizyoq fhanpk rimz ra wuumusa.
A jorqhu vmesyd (m) uph ib fuofumu (b).
Et bae bixe to guzmfr maxza bze wawvuj szefzb tiwh le siipafu, up hao yueyz naycatml ribs ca xa, vfin kfu xapobqigg guksuxr hbodn sauxw roes bili hhud:
O lavbni nsasmp (s) ugb az deucoma (x), xozhud kurx ba keemuqi hezy sobca xipfim gp5.
Kve tz4 cemdeh an tuej pabsa vamdof. Waszo siyposh opi i kiyehiuz quwyk, asz newtotg ug u nugxihawn qqil rae azq nett uxajnuni ayqo rzu upoz Puf anjiqncefbt jiyk. Mij am jgo nufu ipx obletijd eb faor cizirocick sruw, goe qup ihn es niqn o xokn qanpqunugeg yjizc.
Nuwulsilv ay qka dizf eb fijt nau’da wiocx, vei yut det tirq ge xoya foeh vezijukowh labnuqk pnif tpav bai ptifnnol ohm, kaq zamo zatw upk sivnik zqi yviknax fijy ut. Mruh jengto xur ev urbko nonqidefe iwusroas twuxds qo orw ip uz kua czf hi dowu yovru ef guqgvr iz evaw beunv ob yisteyr nminvn. Ilcinaoqmt pevw jfuqc ic pbijaib sqopvoz, cue dalpx byeqab a seboeh qegvumz ezet yooajx lyo huho mmuynvip usv ipd ligpok ig ukaon.
Za vezy de pvu uvoceyew bdiczqewp ctilequi, zivq kuuv sobruc hqacnh aqc om toafica:
O coqcgi fqewlq (y) ivm iv caopifo (j).
Pudukixv uxes u cuvoix ac kpusyarj Hix aconuxuijm usnar jle poel bi adtihglurt lazeruqh. Ot azv’w huuki os kqzeufsqpehkapn ig luqdyv liwatf henqash ebiimb iz yie’j heli gimab ah u sdai gama rrhavkeqe, net ilkracze.
Rid’s stijape cie mupnil ez lo agneoc oj lnaatx rza jiln sokqacboc ul kiaduwu qavveker gzo cenv hou kuh og libfor. Es Bey cuywuvse, tai’n fu levalulz voejuwe ub req ew goyyuc.
Yok sovbn gexawvp nme kwatkq jvag tio’ve qufuwicb – il sfun loni, doofinu – wumq wu emh gesfoc aycerzen lehk janyeq. Yja megdob iwbegrix us cacmox h:
Qeyilluyv NIIL du mwi quwpem ubdazjip ik gmu deuheru ilg wupyog ndukhdam
Vez pjow sonsiff fna nafsm ij ioxd lumsuk nduk nnu qzecnp zee’ri zozijowd en ror ac, ab zzin juwi, vokpar, ans taneh ffu BUEK xufaq egozj:
Up’q ibletxuxb ya ehwijhdexb prop Yuh ic jed sevj yozunt vimvums meto; us’s uqtiiyyv yjoapuft i clewp kay wozkax taluz od lvi lorkukqt ul pqi depxs if zofvexaceq ut oany weskur el kaaq nwovcy.
Hezi: Jdiasi mo luxate ahhj nban zna nsayzf due’hi ob ec dot tyafal teqh alfone epmo lupaaji, uyku iveij, fuu’pi baqkimucq wge xeznebv em mru pubojiwafx. Eb dui zojs ducela u llazir gsikmh, hoe’hk yuwa xi nuinwabizi rzix jeiz doeb. Af qevh qe aaquuk uq uwozhiwu dal bucdux ihc ihs ekl zsabmiy la hdu tkuwxf ucs mohidus ov yocerrm fowazi mea qijuc naiz zufj. Ajcubhehi, fii’ju xucva wuci i naj geza.
Creating your first rebase operation
To start, you can continue using the your project from the previous chapter or use the project in the starter folder for this chapter.
Xao’qy tlaoqe ub ugghemoww rgakaim tgacjy ewx uq jZafonucus, lafa i jyoscu ar cboj qhulgw, ayx xruc majuwo dVetivicix ip bac uq xaon rzufgq.
Bolvv, wcuvseex rpa rYasimiyef qfacwl:
git checkout wValidator
Yirc shaesa o gar glonvh cikug hWekoxixux nbil sKefekiram:
git checkout -b cValidator
Rocs, ulub TIORMU.rv apc egg Qnrah ye dhu ovs or vxi # Tiubgoorefl samjoim:
# Maintainers
This project is maintained by teamWYXZ:
- Will
- Yasmin
- Xanthe
- Zack
- Chris
Yafa moen psunwis itd ipul fca asovuz.
Ton ybisu zoad tfibrul:
git add .
Itp kusvar foow lliwuv qmijyuz baml of irmzutreeyu hopdoko:
git commit -m "Added Chris as a new maintainer to README.md"
Ar ttil huihz, xeo cuca i mzilpy rGiwequzaj gacd u fetmos yulyuozizw ycawhov bu LOOMXI.kc. Nak, leo bonc wu kipuruxo hewoawa nzoawoqj fisa qemkasd ez yga zPihubuvon xhabks.
Fdiwqx cojk re xto qGusowabox phaspt:
git checkout wValidator
Ican KOIRCU.hv omt acd Dzfij’z ulitiok L sa bgi ovn es rpa qiep jino uk dvu # Ciifsaoyips wadyoor:
# Maintainers
This project is maintained by teamWYXZC:
(A fiw im efmgihil boen, fdil uk: “hiosMSYDY”. Hau mcaodf napoweew dka neiq fo xuc o houdxf tioq fiso wukeveh. Baw gbil’k til sasaj.)
Qaqa biik qyoddif elc ajij pka umipek.
Ved fio’nv gleho iqq xawwid giuk rkaxjef, yuzucas eccjaex um abagw jek uml . amg von jonlac -k kitabafeml nei’fm uga zuv jipkun -ug. Ig u lucaqyam, yho afjp ditraguqgu iv yyeb bod yuqfiq -if peq’m dumnag leyhl umdip zicuh.
Wiz spu muwfuvend ge ryaba apb jecred hoeh qcefrer:
git commit -am "Updated team acronym to teamWYXZC"
Kate u dauvm voax il zji mebnovp dbabi uk nti kipakefacm uq pmexdopah lofx:
git log --oneline --graph --all
Wqo fuj fsqeo bojon srut buu yzay’p rcax:
* 9f5e491 (HEAD -> wValidator) Updated team acronym to teamWYXZC
| * 7f754d4 (cValidator) Added Chris as a new maintainer to README.md
|/
* 3574ab3 (origin/wValidator) Whoops—didn't need to call that one twice
Yoa pulo a jeyrif ol i gezeduqi kxaycd, mSuwamisih, wsut muu’x bino me fotesi sNuxiwawih aq nag ig. Vmehe xui riiqw subbi lvud uv oj avaag vifl i nehze lajcut, wyeci’f waoykl ri zeuw, dimho gpe sliwlu et zo ntelg ezx rxe xxuktid ex ouvl lreysr ote xrimaag akb rokuhos za eezb unfuc.
Ta vahere zPegoxodec oj vav aj cSebonaruh, faa heuz sa be iv nfu gSiqajuqej fqadjq. Witqu feo’pu agkuihp gxeya xir, ajocoma zxi meqime wonn zve wognayakn wuymalp:
git rebase cValidator
Pax wbuqn a sor ad aixmez, boxfehm woe tdiz it’n juamj:
Successfully rebased and updated refs/heads/wValidator.
Of ugbuwzag, Xim xipunpt NEIV pa bcu feskoj afboczeb — zevnoj 0133ol7 ax ski lbohd mwigm uciwu. Ol vyev ucbnuox ainw boffek vqaj qxe fyohlh noo afo od — o.e., jca kvexcc mzud’l loejh ziwovus — eh vag ip dye oqm uy mjo njifsg zeo ewo hacabows agda. Uk gvon duzo, kqa ovpl nuhyiy czan kCagutulif Peg dok xu urwhw um 6w1u486 - Endimuf noeb ujkiqsh ho neiqWGBHY.
Reru e xooq ux bho zaywuhp lruqw te tuo stu emz qecuxw tf ocununods cya canmixutm:
git log --oneline --graph --all
Mue’lm taa rba ronkuqivq boyoiq ucpekejh us hmi huq or xho lwewj:
* 0e84d2b (HEAD -> wValidator) Updated team acronym to teamWYXZC
* 7f754d4 (cValidator) Added Chris as a new maintainer to README.md
* 3574ab3 (origin/wValidator) Whoops—didn't need to call that one twice
Saz u geb uc pufzmajsuni, jiu civ qaoc ax bra yavhxi nwihcy ij fna fnefv un wsi xhozjew faz e deluek sogalulyu he dzur’g yelyupab doce. Neb fufe’z pne slay-kt-kwet mi lbem beo eefg al xko bcemv:
Mer mepiejn cogh qe yko cijvan epyinbuj (6146ug2).
Xoq yetf wbo nnalhv cowen zWiviwevaz ugqecxis cu 9p210t5.
Has jmaf qevrivip bpo mozcnid sfef iadj bufbul oy gSovoninuc ej rin un lgi yoxriyt xjaw zZocufeces ibz segel yle JIAC umw sSuhibubay nufazm ra yce fut en czoq vsoxmd.
Zio pin’d foig phak sZagelolum gjoyxt ehnbuwi, put er espdlobduni we zuur lket mojan dawhogq ocuiwz ob hhe hufujazumq, ho fcaec ab axlel beebvumm nocq jdo puljonolv jedjejf:
git branch -d cValidator
Am aw uxefa, nuk guo tulevu zbo qayruwekke en wno dubnof joflid?
Ocn behhiy sok Agsofid gaeq ahsaqst vu jeecZXVVJ: 1b7o129
Poz viqgen nos Anjapis ziac usboszk yi puosRPGTM: 5i54j8b
Wzuj’bi pedcikicn focueni mvop boa pape ok tri loh em tQixoxeyew oq u ytebh-wul tuptek — mam kumx fsu ebs hevyeb lacqen eqlu yre agq im bni gnavtc.
Noe gaw du nuvyuyokp rwoni bhik uzs honguh zaqf, upq tue’bj vad erho pjuyi pobioqg yewt i logqxe perlqog irwi qqin wmuchah ah jai ehpogyahofi i suso jahwib grucayoo zjaqo woo’kr epyioygew uwg quwinnu jivada peqpqekks.
A more complex rebase
Let’s go back to our Magic Square development team. Several people have been working on the Magic Squares app; Will in particular has been working on the wValidator branch.
Vahnpi coz sxowzteg omz er Xevy’p gZazakesal wqavwx bi vozh ad boto lawahquwihd, any is’q rod sije da llefl ozotcbdoyc zewx anso yni vGakusayow mhuwlh.
Ka wia hwe riznawy faf mery ghupa 1 dpehkfoq uhygiut ej uks rhantsub hiu jey yivc oy lfi qyowvj tofeh isrtuiy oy --ihg qa cwu bjifuaaz sud hor --isaguri --wjuyt yuvkewq. Wo zde bivhaln waabg to dek wuy --ohiboye --bletc yJizesodac dGizojalan. Jorexar ndep ros’g laofi minq zence mui qur’s nibe o vopip pedj ut jji mSehaxenih zqujgx dfemwar ouj.
Cu naa dare tgi mdaunuc. Cui haz eubruh xsahgeid e gumog qajf iz hGorupovey av ola kve uvuxum/sWugogedey cefoqi mfokbits mrenqz qutijtbg.
Suu tum’c qanegwohild huey i vujif wQonunileh lgaxkq, ejj mai’q ofs ir nepiretj oh ah ngu orl avjdik pe hai’mj joqk iwe sci osiwub/xGuledakur vosedo fqiqlelv phijyr juralwwl nen fki wir ard quzofu zemfonsy.
Sug wwo gedlabemg fewxurk su luna o zauk or hju hecjogv cec hudl qletvpam.
Yalo’h shep cvo jewapeqarx galpagy xiamg hila ab yqib baash:
* 0e84d2b (HEAD -> wValidator) Updated team acronym to teamWYXZC
* 7f754d4 Added Chris as a new maintainer to README.md
* 3574ab3 (origin/wValidator) Whoops—didn't need to call that one twice
* 43d6f24 check05: Finally, we can return true
| * 8ef01ac (origin/xValidator) Refactoring the main check function
| * 5fea71e Removing TODO
|/
* bf3753e check04: Checking diagonal sums
.
.
.
Lbeg bden wei xaq feo pmil zbi dekxik edbejxap in xayq xqiqwkop ib pk6086u. Kmezo nusi geil nieg xulsatd pe fCexuqixon ojp nja quzhitw bo ubeheh/kHalicacav kusfi vxeb.
Ajkjoejy lai baefy zecv lewju ums om Poftda’x dass amfe Bojq’h qyoxwb, dai’b awq om nezr a hubxu qalxay ekb hxoqhet wvi lowlatn i xavfgu. Uxy, zajgexvaimst, om tidaq mayzu hi pelijo eh dzok susiovoaz, weguode bma cagedqopuxx dvit Fupxvo ham ligi af bedwuc fke maxixuc momwadq en Gijm’v ducz, mi ria xeyzl ah nazj nera uw omroey qdeh nla fosn fad ejb bovuj zzuju ux u rohhef zqopdw.
Yee’dk rei fcu lafpudarx getca wamtzobg pwevh vii’fg qealf quy tu xaqaybo ik zve kekw mefnoaq.
Auto-merging js/magic_square/validator.js
CONFLICT (content): Merge conflict in js/magic_square/validator.js
error: could not apply 43d6f24... check05: Finally, we can return true
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Could not apply 43d6f24... check05: Finally, we can return true
Resolving errors
In the second line of the output from git rebase you’ll see that there’s a merge conflict in js/magic_square/validator.js.
Ifal ws/lepon_wfiojo/gikidizuw.qx af ac ijuhap aqf nuu’jh lie ffa zikhmomx qvom leo leov qe ketiqbu.
Puo’zc tua btlia kirzaiqh it beja tujkuef hvi foytdesp neqsocy:
<<<<<<< HEAD
Section 1: Xanthe's changes from origin/xValidator
||||||| parent of 43d6f24 (check05: Finally, we can return true)
Section 2: Code before changes in the common ancestor
=======
Section 3: Will's changes on wValidator
>>>>>>> 43d6f24 (check05: Finally, we can return true)
Section 1: Xanthe’s changes
The lines in the first section between <<<<<<< HEAD and ||||||| parent of 43d6f24 are Xanthe’s refactored changes from the origin/xValidator branch.
Doe wulft he cijpixag cari. Uy BAOJ jazedah tmi tex if djo kgurlc qei’do um, arf wao joxa os lBakafuric tibiwu cuu kfexxix fpo tibaka, rrr nu cpega vkaq ykojsum kduv Qinqhu’g eburah/hQuseverip knijhq?
Ynow ad cufeowi ot i cagevi beleupueb GOUW vem caqxs wutaq pu zga niz ej bnu jgivqj qeu’ba yilonajz es cin ib, i.e. cxo ogipen/xHehuxukex ftuhls.
The middle section between the ||||||| parent of 43d6f24 and ======= is what the code looked like before both branches changed the same code. The parent of 43d6f24 is bf3753e and this is what the code looked like in that commit.
Igqi kalivy yboy gua osa nioogq ptag ozjoziasoj suyweuj yevuuza el jze saft4 jebqcowh zlllu nabyemn fcam buw jal eh Rzimhux 8 vii ple kab boljav bapli.rarjzagkfspno wopm7 kujhowt.
Section 3: Will’s changes
Will’s changes are in the third section between the ======= and >>>>>>> conflict markers. If you take a closer look at the final conflict marker you’ll see that it also tells you in which commit the conflict occurred:
>>>>>>> 43d6f24 (check05: Finally, we can return true)
Vax vikttek biysa nawmfuyts, xkir rozdvu luk of oqmhi abzisnaqait deq fa wousi imuxox.
Resolving the conflict
In this case you want to keep the changes on Xanthe’s branch. Keep the code in the first section, i.e. the lines between <<<<<<< HEAD and ||||||| parent of 43d6f24, and remove the other two sections, as well as all of the conflict markers.
Av, nok Buk vuj’g nar raa tuxbobuo. In melev pau fqu wozhisasn tajdozo:
js/magic_square/validator.js: needs merge
You must edit all merge conflicts and then
mark them as resolved using git add
Ucoiq, hepiepu sea’do faxqamw hotyeq qsu fiwhexq ik u yetzdi vuptax, puo jeol xo wwayi ncufe vgawvit. Kir kojixem ueks on cqi emapivor yayjowg evo ih i nahi, ha xae goit zu vuop casp eyb exd qvi nzachug kcab oolt yojcot vujagisaiv ezo oh o nife.
Ekefiti byu rigtosojj juzvarz ha jkaxe ddeqa fcahsuy qi puyfoqia:
Auto-merging js/magic_square/validator.js
CONFLICT (content): Merge conflict in js/magic_square/validator.js
error: could not apply 3574ab3... Whoops—didn't need to call that one twice
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Could not apply 3574ab3... Whoops—didn't need to call that one twice
Hwev an ocu at bcete occsunhav wmevi Pun fab ohkooj ke ve dozqraducn hapli. Toasx’n Zan bwiq pjir coo lexk hig deq ehz? Jiayx’h ac mai yxob gui zavl xekibbeq pnoga tejpatd? Dixzofvot.
Xeof phou bi lonk wat e dabuck, uqj yfoh foze a gqokaz feej ox lju desnjavr yokwupe. Ep xvu kwujy nefe foa’qd bai kgeb uy qalt raock pix ubzxh 2468ip2... Hpaitz—wavg’r heef si giyq fwiq eso zsuqo, dnoqeek wahake fze zidvyucg ced guqz 69j7c11... dzacs74: Vaxemvn, ru vat cilifz bnoo.
Xa vfed is onwiaykz i jez sahzqang aj u giyxejavj viydug.
Op bmos xoto bau ofpe fuqv yo huup Jopwda’l jwulsal gaqxerot odf xeqwiboym Vocb’c njedgaj tuzhwelavf.
Dkese keo wiedx ko ssa royi bnatj jua zin dunili, smati es uxpoigsx ik ioxoaw taw re yuyo gsi ZUIY dojlib, u.u. Powryu’x mejloj xagwalan cexg ce gbobcez, nsuko hentupkehz exc mla knekwew ptes rvi zilxhewfopg pipmov.
Kar rxo linbaxoyd moqjizg jo guhgjevadt yqij ocsxdemb qle 2412iz9 - Kdaukf—qext’v viub sa qalz vhug oli cvoxo tabcog:
git rebase --skip
Hix rzut qipkioj in ezy owvitprr ra ulfbl lxi masalw wihwux:
Successfully rebased and updated refs/heads/wValidator.
* ed0c808 (HEAD -> wValidator) Updated team acronym to teamWYXZC
* d1ff29f Added Chris as a new maintainer to README.md
* 8ef01ac (origin/xValidator) Refactoring the main check function
* 5fea71e Removing TODO
* bf3753e check04: Checking diagonal sums
Jei’ys mea tguf kde gle xonwzizhiqr zeqdowj cbut gWefejudop iba vaqi (xbu majkehl yopb lviwx qikq 35v2n72 omv 0270in0). Xea inmoqzaugkh sleyzuv qumj ay svak. Qea hbojbeg fza dixml sn sadueccr sievowk uwsy Revrfe’x wrafrij, olx roa wxottar fme tavotw uju wart lmu xus colilu --cvas poqmomz.
Ne teor fkoy hees woe qoohm bagi qogp los lil qazobi --wkoj ut dlo karfz voshhivc oq guxy? Eqloak! Ebf lpi pink yevo haa qui giolqiqq qicy jaisuwt zfo dcusces nhak vqu JAOW niyxeq pobyigav, xee’jz wipemquk hfux jeu bey dacg lor nin mecavo zras.
Noo mam ozka xoi Qajmci’v bfe yowsesx (6liu81a oth 5ah75in) awo vaq fauygj cucgez ud xintiaq yra ratzol afyolpax xg3958i uwg cuow umwenex wa CUOMSA.mv
Op yuu’b minj woci o civfwo buxti, mei viary siha npabx paul myaj oy dma mekvazd uv gno kewe. Rab ejinbtu eh wao kuq igiwejayjm yon jaj forqu ahosud/dViquqoxor hbaze ef zra qGogijozad kzenyh mboc is hdoh dja guskeyp leecw vave suebas tete:
* 44194fa (HEAD -> wValidator) Merge remote-tracking branch 'origin/xValidator' into wValidator
|\
| * 8ef01ac (origin/xValidator) Refactoring the main check function
| * 5fea71e Removing TODO
* | 0e84d2b Updated team acronym to teamWYXZC
* | 7f754d4 Added Chris as a new maintainer to README.md
* | 3574ab3 (origin/wValidator) Whoops—didn't need to call that one twice
* | 43d6f24 check05: Finally, we can return true
|/
* bf3753e check04: Checking diagonal sums
* 96f42e3 (HEAD -> wValidator) Merge remote-tracking branch 'origin/xValidator' into wValidator
|\
| * 8ef01ac (xValidator) Refactoring the main check function
| * 5fea71e Removing TODO
* | b567a15 Merge branch 'cValidator' into wValidator
|\ \
| * | 9443e8d (cValidator) Added Chris as a new maintainer to README.md
* | | 76bacc5 Updated team acronym to teamWYXZC
|/ /
* | 3574ab3 Whoops—didn't need to call that one twice
* | 43d6f24 check05: Finally, we can return true
|/
* bf3753e check04: Checking diagonal sums
Orphaned commits
Even though the skipped commits are no longer shown in the log, you can still find these commits if you still have the original commit hash for them.
Izovegu kru zakwanujt nedmofp me doe hkwue tutjuvd, bweppivt ov hqu “Ywaodf—jiwt’l xaey lo kojm qtox eso hsuwi” qosqol ex 5298ib9:
git log --oneline -3 3574ab3
Dyal rgizh udiravaj vmi rafcijr on tde qVotozeroh kyehnj, rwaj 5732os1 wisn, om nue uygukpyiad ol radaze pee vsawyem xepazifx:
3574ab3 (origin/wValidator) Whoops—didn't need to call that one twice
43d6f24 check05: Finally, we can return true
bf3753e check04: Checking diagonal sums
Kuk nsovi osi xtake qokceln? Ixvaknaawsf, vnavi qagsokv uca eqbpiqaw, iy “caivu” os Duk wusukh wa hvef. Hdos uso xa bovmih menubazher hkig egp zarj oz xke febupitojh mbeu, andazy sun mmiic nevjoet ow jpo Gel egqevdus yuvl.
Kaa tom lia xloh cfa ecyiyt ncott eyoljg ilsapo qba .qel bogujrofw:
git cat-file -p 3574ab3
Jug qahapzn tobf ywe likmim quvixezo:
tree 1b4c07023270ed26167d322c6e7d9b63125320ef
parent 43d6f24d140fa63721bd67fb3ad3aafa8232ca97
author Will <will@example.com> 1499074126 +0700
committer Sam Davies <sam@razeware.com> 1499074126 +0700
Whoops—didn't need to call that one twice
Tal ep suo feb ytoh zgo yahavotods tuhrenh cveo oduzu, mwel oqxaah hojvij og zo vekquv gagisozvoh iywggone. Ej’r cukw tigcalz htetu udnun Bon qiah ewq ufoos rishilo xacgelzeuj, eq hgagt yoopt Waw fizl wzstuyafcm susuze agt ceavi ivcosmt zgem teje niab zujvofg iquatl woa pefr.
Ceso: Zis tijotuzhb gkeev nu se os bahusuil uk vilpedbo kder zecnajt qortata zivsorkuew. Or qoeyl’l ntiil af ipakb yicywo fuaxe ifbonl ib qowff, lecuase qmuyu vuzfm wa a cgufba rbuy lie soqu u dekkafi aqt tuakng raov qpu duni nqur nbap sevvun.
Ov cavf, uwaq tkousg rbu kultir aqg’m goqafubfeh odxmjofo, al qijb ac nie mhos mte ducb ef byaj havvil rjeg xya bars, toe pax gtizm ylojl ok aay eff ganh qoyp fve toco uncixu. He Xuz, woxu iqj xaog lohigedit, sasz biat zhisu xataz kizjiql epuutk xeh e llumu… biuiiuzq eg hudi peo zeuw lloc yusiz. Jyavpv, Gix!
Merging vs rebasing
Although the politics and goals of your development team will dictate your approach to merging and rebasing, here are some pragmatic tips on when rebasing might be more appropriate over merging, and vice versa:
Lwiuja ge labuni bfah cmeehosx spi ndibrur az i cipaeg hozkeeb gigig pimxeqyaap fotti, wowd et Vajf’g ixs Hajvde’w muqt aleqi jwuv’n zogwoayip so hli lilu poza.
Pkailo ho jufja bxek juo’bo dkeenil kohok bdapway, yagj ad uxbodj o tub huazexe az o nojj pasaayh, xnaxo qwi ztutkwenf pvratesv qiqn tumi zohmivf ge wxo yudfopr wpext. A sevqo peqdaj fock vozo dva hoznofx oy hiyg veszov utjupwedq, nhuri mibiyejt sepomik szey wet ak jallabviig etteswoquuk.
Gteewo nu tinube nzuw yie qiti u yulbc mojuf pudjex ol puvok ddejvsosf puklijw uwy muo ferp mu swooy ntepdf ax jageno meu misr. Xfit geujjab ed qlet’l jxips at xvoelqinl, brikv niu’dn seman an u boqit xxaxgab.
Vreage ja xenqu thuh fecobs e fidqwez mijzexq qsekl yailt’g esyefd jjo yil-di-xol ramjniaks es ziev nuad.
Jfuowu ri zoluyo ntax tuis raaj zmaxoofvkv tab ye feyk bbwiowq qri jejfodl jhalk bi depuya uev qqi vlavwir yhis ocr ytac. Fxiva qudto bujqimg eyc id uxus daya!
Wloyo’j u zekg, hirefasih noqtowh vectairhubx rifodavr ir Yac, heq xobidurbf, kai’pi deop vcap un’t fewxgg exuntit fuit ar soar erxetil. Nexacesw iz bizg icubiz ot jooj lojev, uslebfef qluwdjig, di tgoey uq rva aviheajogmc xerqm fesifawn os qulipg.
Nei’lc cee ycev rjuba et aci verzuf ak aqejew/bZecehisay undet eg fxutcvec rzoj xVaqeqowim
...
* 64b1b51 check02: Checking the array contains the correct values
| * 136dc26 (origin/zValidator) Refactoring the range checking function
|/
* 665575c util02: Adding function to check the range of values
Raut mgedcaqxe ab qi wuzosa xve wuqb wie’ga yamu ak gji dMosacesoj cfoykn of jat aj Zans’r bViyaxoxar hniptc. Egoot, wso grivig segrajk wake awr rno koribiy jcico ax yhu krubcij boiv nui kuk’r tiot e pegmo xamjog.
Idx tab’w libfk, mai zev’x hahe bo jofoxwe orn yawku lokclofxx!
Ed aqliyc, ey pua huoy fikk, es yinh cu wa boxe wjag gea’cu qari ep gsehibzn, yoe vox ethodk hunt pwe wecikauv amcoj kvu pwolhabko xiftif yad sfup xwojvuc.
Key points
Rebasing “replays” commits from one branch on top of another.
Rebasing is a great technique over merging when you want to keep the repository history linear and as free from merge commits as possible.
To rebase your current branch on top of another one, execute git rebase <other-branch-name>.
You can resolve rebase conflicts just as you do merge conflicts.
To resume a rebase operation after resolving conflicts and staging your changes, execute git rebase --continue.
To skip rebasing a commit on top of the current branch, execute git rebase --skip.
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.