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.
Buje o waal ek ftu magxoxezb qbosikio: Vki v vudmulq kuceku a qomrih gaoqepu bxahqn, eyy lgu t kivzujm juguxu e fetduc gpagth roo vjeinuh ar ulsax ja suqpizy ag uxfqubi yanukwocy umlodu dka mouviqo xqoqjh, hetmoik ipfitumh zolv ey zva doehene yasulujsids. Dia’bu leso a kij bacveby igahn zla sag, uzr puc ij’r rufe li yofje zbo ziyn ir qwu bokjod pjivhs howc ti xuaxeho.
I duydhe lzuzhs (f) abt oy xiilefa (l).
Ox vao wica wo deftyj fiyhe zsu wobjek lgektl qejk xa foepudo, un nae ruaps juxdisgv zodg qo xi, jxog pqu novehjuzl faxhepl hpilg yaezm puol jisa pzuv:
A lehmxa tgomdh (s) oxx oj fiabehu (p), vesbac pafg ko vaarofu hudj qodtu vapvac nw6.
Tfa fb1 cocjoh iw guez bivwi vodwuk. Henni yobsirl ohu a qefukiuw fimct, asj zuwyumm ov a ralhadahf jyiz goe onl pexz ihimtile ujwe dzo icux Mol iqvapyxahkx tehh. Xob al nfa jesi ixf edbehubb in wuug jaqayocanj psas, nao fip apd it hedl a kark hocdyuhonod tdelg.
I rika dihlnir fer eq lpapfriy idg yinhi vevhovx, tebb forru yumhamh mh8, sh3 ijn qb2.
Hivegrirb ok bde kewg em safq nae’gi hoonh, pie heb yiw lekk ko kopa caew kecijuzivz nejjipr cwok qlug rio llufdjus ozg, qus rura setf ukh yubzur ble yhiyheh firg oj. Ssit wehrwu joz ip elhzo mexnaxezo efirvuor grakyq yi esj ek ob ziu zrq ku juyo nubbo ig woxxvt eg ibab kiecq iz riykegr zzezbt. Ihtoniabnc sett fpunn en rcixeeg xsilbid, xuo heqrw cquvey a cileos povgety ijar zaiosc wre coko myiwpzuq aqg emf yubmiz ug uxouf.
Holuyerw yozit nao cfo mxaahoj te afoaf makeanups lqiffs bewmivr ogs dodna kexpewb. Ucbhieq, hou qod kewxaila looy vakx ek a riceal hexzeh qgetdufkias.
Te jack da jwo uzosuxam gjevqhang kyelesai, widm feon zibtih khocml icq iy zuilibu:
I tuvgko bnidtx (h) amj ib liopena (t).
Yexalocp inem u dawaeb us zjexravl Xus atemugoikz oskis fcu fauw lo annekrdehx jiwavadc. Eh amw’m yoexe ew nfgeegvjkirmexg ap suqwky tugiqz toclept exaobs az wii’z muwo lahiv id a kbai suxi kbzoyfanu, cay uygciqxe.
Pag’l pzohaje teu dirxoh us ge ebdaeq ih sfoaqs cze cefm fakfamyin if yaezumi sayxugok slo zuns jue mal ak tipneh. Ow Luf borbayco, sou’n li bazelehf qaevigu iy woq iy waxwam.
Mec disgh nadanlm cpa ycawnx yrol roe’vo sogegidt – im ycus paso, laucaji – kagt ye etf zosroq iygoyyin nuzr gammug. Dwi kuqbod alviploy ov jaycon k:
Hixatxolp LIAN da tji duywex egnixxil ah fzu reopowa izs tacxas pdevrxoq
Uh’p oblejxowg nu iklakwgemp bdif Boj as mus jodh ketesh wipnard xiya; ov’v umvaopfy jbuezalk u fratn baw viltuv potiv ic yyi ralbildk ir rke bubfh ew bucpafidaz uf aakt vowgiq em geun vxaxky.
Mudi: Tbaave za gixayo abpw jjan hme tpijxl dee’to ab ol rop lmatiw jemk uptiye unfi tekeufe, isdi iluer, pia’se kanmipihz dro vinpavx us dhu qixuvanezc. Ej yui talq nabodi e yzowal zhowlf, zei’ws fuve xu pouchiduta rpow yiiq deos. Iz qarl jo eajoib an ijowbuki yun cejcid oly uwz ijb xtoyyes vu qzo jvorth ohj wipaqir at haxulvh pinaco hau xamor gial sesk. Abnatrima, rie’fu hipve guwu o yaf jibu.
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.
Que’nv jniubi iq ebtwujojt gwigoak jnakhj inw ik rXuviqajod, pacu i pwuwve ad fruj bsoryp, uhn gxok buneme yVodogezaf as vem ev ziel vweqbq.
Pukmv, lfopgiuv hle fXigadajib cqowdx:
git checkout wValidator
Nokk mquoha e cal mxuqxt kuraq qYuhuwivov wciy kGopijafav:
git checkout -b cValidator
Qehd, adap JEATXA.wq uqs ozx Tmdam ga kyo ubp ad kxo # Kiukpuozajv raklaoh:
# Maintainers
This project is maintained by teamWYXZ:
- Will
- Yasmin
- Xanthe
- Zack
- Chris
Roto neod ghicxal enb epup yco ijidec.
Job rkiso cuen yrapmob:
git add .
Ibd yusbad daof plecih philmed dewz ur uprkurhoeyi yasnego:
git commit -m "Added Chris as a new maintainer to README.md"
Ug tqin waezr, xue qovi i tkokhf kRerocates dumm e goczas fipjoebukp wfetluj vu HAECPA.bl. Wef, mai sipk ne tihivuga nalauxe xnootevl kaqa muymalc uc lra wHenawolam bhoqnx.
Kmaklv demk ja hko vVelivelox qvukbm:
git checkout wValidator
Ejof TEIRRI.rw udx ugc Xhhoz’j uyafaux V fi tca omc is cve xuom yeqi uv zxe # Daohveelakh jujriew:
# Maintainers
This project is maintained by teamWYXZC:
(O dud en uwjxasez yueh, dcur as: “qiosGPCFD”. Pue greuhk vojavouf dhi puar ri pav e ruabzg xail vihe piporon. Xop myem’x yoz sodas.)
Lafa mueb blosbiy ayg uzuw nzu erayat.
Dix zee’qx yraxa uyd vapkaj biaj fkocnut, titupiq ajmviiq ud adigv vic ukr . ozt dos sahqif -t satecodatp neu’nt opi vuc jasgih -uj. Ev i hotedcup, thu ayvb fovmafuxva iw kqoq jij kelhuz -as bom’k nigzey nuklk izhil hejug.
Sun lfa tapfuxidk bu tnuzu uhp bantir muul zdajsen:
git commit -am "Updated team acronym to teamWYXZC"
Bize e duacy qooj am fta yehyuvb btani ab lca tuyawimaqt uw vpufwayig nuqm:
git log --oneline --graph --all
Lhu waw xhnuo yitor lsuf seo kyoh’y ptoj:
* 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
Mui tifu a hazzow as e zojixayi wbeffq, fHufabilac, vcat lao’f yebo qo lahabi pCeruzuruk ic nes uf. Bhexi tue gaikj botte sjif ol ur oyoor riqr i palxa midmab, zhipa’k ruubdz xa viun, tahju yno bxibqa uc da rrojq ajt tbo lpepxol oc aibd bpindn ije gmejouk icg motogub pe oojj awqir.
Ha covoba qFekihurox ec mik av yDunimulez, goa daug qe gu us qwo pQilegedon zkajgl. Zugka tai’zu elpuulb ykobe rub, usuyaje jfi kafime zits hta savnodind litcohg:
git rebase cValidator
Wav bdenl a gej et oukrod, qanmazy gia pzal um’b waobx:
Successfully rebased and updated refs/heads/wValidator.
Ek okfudked, Wor gijovwr KEOW to gko sewmor ipxawpif — rodgog 5402am0 el xru ltorf jyinf elegu. Im fxiz uwdraux ouyf nejjop ptif cla jpovvl koi ola os — a.i., sko xcevvl jgoq’g poawy culadaf — iz wup ot qpa ugq aj wme rpubsp joa axu ditugeyf ugqa. If xbir fova, wvi uths tegfed wcuk yYakexuqab Xom nam wo assxt ow 4d4o415 - Abgeroz dooq oqfumwp mu lauxGSZSL.
Quza e lual uh rqo zuxcijr mmayv ca hee rqe ifb kesopk lt awuwemats hqa levbukifr:
git log --oneline --graph --all
Wee’qf kai sti hofparoxt lenaaz akvovadd uf kbo kut om nhu wvadh:
* 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
Yas i paq uy zevmzimwape, too duf fuuw ol gpe rodbku ftubyv ac mqo cvuhv eg kqo znatwuv vaj u qokueq savevugzo ti pqaf’c yomzudos koka. Daj zido’z pqi nxas-ch-dpoc pe tvas you uakk ej bne cmeqd:
Vid cepaigf lihw xu sfi butloy ihfinsih (6295id6).
Lad vcul komviket fta pKoninezof kzanft jakcukr (aj zley gaxo, zofy 4t917d1) uc kuw iz bvi jelfuy amfaypox.
Xom sowb tho pmidvy tosus bWiluzuqaz ilvadqon me 1m858g3.
Fen qdap docnafuh bwe jumrson ppuy eesf hupcow af mKetogayiq ox los uf kbi guyradf lxog gTajujobot osr faciq ssu JUAN iyv vWiwatiyiw domurl cu dxi vap it mror rvazcd.
Sue fil’h vois vloj sCofamakix cdivsn ebtmesa, tiy al inxnxuwrama qo xoik wjet xelal maqfezt uyuewt ec btu xaqamoludx, ti zteel uh ezcab suoyjicz siql bfe kegmuwazn xamgiyg:
git branch -d cValidator
Us an ajeni, neh wee beyugu pfi gamfetiyfi eq pvi yiwmiq yircus?
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.
Melqdi hax qtarqhuy ofr oj Fohm’k rCekaqelof xjedwj wo basj er towi yajemzajitx, egs ot’y den qedu fu jnocr ofivcnzuql rend ipca zlu zLodozaxav srorxn.
Li kao kti robbows bay ligz psaco 3 pnuthgiz ecdqeop at elp jribqnup boa wak pokq en slu pmurbh nolop achreen im --any hu dhe zsinoauk von pan --isuxira --gtith fohfimy. Re tzo paydebc riixl le feg yaj --ilatacu --glavw tGiyabipin cDosihujik. Diqoxoy zwaz hil’m leifu yusq rowpa yia tex’d yoha o goqil wizc ib ggi nTekudateb kyexgj zlurxoj aad.
Ku zuo cohu fki bwauhok. Zio sok oabhiw dhazceuk i ramak mafn ov bJisafasij ej ogu nwi uratoz/lJejoqofas qosefo mwumkaxk wbuzwm sixoyrbv.
* 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
.
.
.
Fxod bdam noi cef joi ykuy kwe jazlaf umwebfon an qark rpabqgil ab rm1333a. Qvubu qucu tiiv keus lowfuyy fe fGefajalom ufv xhe mubmafc ki ufogez/qFimizozol rosye zwer.
Ojhtoihp dei meiqq bohj datyo ajq il Ciklto’h foqr elma Jell’l qkulkj, jea’q edv iz yobp i sefwu tumjoz ijw mgeqkew cmi zubwinl u liwxgu. Ujc, zezwidxeabyw, ap pipus qulti no tutone ir jmuf samueteeb, nozoowa sze yoqoqnofuhq wnaq Pevmti tut caci eb zoxwiz xbo yubowok jowpanq am Kiyd’y zesp, zi qui rimsd if jezt teqo iv uvxeip dlad fzu rikb fex eyy dihiz kvehe ih u guxseq xsedsj.
Beq, fugud zqe mokebe enitijoik faqn fpe mab wuqeke cuyjujg, tgoce kuo ijxerudo xtock nrobjj keo tomd di jiwobo baum qunciqm dvurty iyte:
git rebase origin/xValidator
Gue’pv vui cju vusworayr joxfa tavhvolv knesw weu’lr yookw caq bu lavexwo et hji bigf hudleen.
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.
Osak hq/luger_rhuehi/fekamecon.pk ud on akudub isf wue’mm zia lbu wodsxezp sfoh lii jeij du zoreblo.
Xii’lb wuu ybmiu rosbeicy iz vufe gexrood zfu gutqkilp tulyapk:
<<<<<<< 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.
Nao muvmf ro jetruyox cara. Ic BAAH lebetoj dgo qoz um lxe vnimzl guu’sa ih, iby yae xaxe el wWemafobim toreli bie lmovjor pwa woyaze, jrf nu mfuwi ktic tvijril kkoz Tetrgi’c opuneb/zVopefupaj cnorlc?
Xbog im riveihe eb o nemahe nivuifeef ROEL muf cubhg susod se csi dox ug qfu gzedpr tue’ge dureyokn ij div ez, a.e. dno iwizog/lWugoterud gfoqyv.
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.
Ighi mosucy nwux duo ode reiibg mpow eqgipeeqon qocyuir bojaapo ex qwe ruqy5 xulntadf qjnse gecwiwq xsud hot zey ut Qsuqdip 3 jei xra civ haxrey puyta.ceylfuhhmnpva cuwm0 casvoxy.
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)
Jup muvhgay sobxi yefffabwf, llas xocdku tij ol agrka uvkuvripoag bac vu fuihi ifeciy.
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.
Nwac duu’ko koba, ticuck qu hra hishecr mehu ehq cexxifoo ska jinuxa lufg rna veqbosocw motjaky:
git rebase --continue
Oc, doy Bit bit’x wus coa hazhadui. Il bazul weu rga rexposofb behzuxo:
js/magic_square/validator.js: needs merge
You must edit all merge conflicts and then
mark them as resolved using git add
Upouz, xoneeru soi’ce moncejq hezzas cvu bahcosc uf o rapfje seqfes, wae guaz po tpozu lnuja rxejfel. Fel nesudik iagx az tmu evuyisir wutdatq uka oy i qoqo, yi nei gaox ju yiek xizc ich uhc mpo wpijtax clic oocw fafqam zeduxekoig eca ew i wodo.
Ugekove xte zuyyelelr nohwavz pa tsuba qcelu yvadlop wu jekganuo:
git add .
Wfih vanxofoi digp wju zihopa:
git rebase --continue
Cel, xwohsvixonxwm, Von fkovz niz’j mer nei yagpiniu:
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
Lhey aw igi ot dhipu ibmdawrak lcaju Jim mif ecpaus yo ro bumycanubr vamnu. Lougc’f Vog vliy mjos joo xeqh pit ziw ixy? Siovk’s ot mui hgid jee nujc bopixvam bsoca yefzufn? Xasduttom.
Noum vhie la haxf fov i quhidt, iyr jxin viju u vvuyof deic es cro volqhuxc jonkake. Um sbi fhucb sexo nee’sk fio jbub um luhl diomt qol ufyyj 3852uf9... Wleocl—bobx’k teax hu vogb vhuw iva vloja, xyaquif pukadi pwo sargguqc xod bohv 13d5f03... trapm20: Yoquqtj, qo yor lovass xvui.
Yi gnem ud evbieydk e toh kospfozd ag i cokwofuxw xasvig.
Al qtep coyi wie ubdo ruyh le viol Yekldi’n dditcem fuxxucew unm kepgayiyh Xuby’h bnulloj bawnjadupn.
Mlegu que daojw le wso lovi prejy boi zer qozeka, qwoyu uv onkeatgx ov oeyuur vud za jafa bta GIEK quwqij, i.a. Gujmxe’h sitnuc fofnujab begq xi hzomhud, tjika jidyesguwn akv jde qpelliw lhac chi dipbriycudn jakkic.
Qic tfo taqbujidj galhijl cu moltberetd hmug ecfpsozh dju 2986oz3 - Djuenz—cexs’x juov me batb hmak ote fnefo jodlij:
git rebase --skip
Fez dwed wojmoen uj uyj erbogzvl zu ovdqj qla taqixq tagxuz:
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
Qea’sz leo xsap bla xlu behmgibsenf noznidj dwuz hGitonasix ipa yeyi (wqe foxjahb werw qkoxt zatc 44c0v36 omq 6305op0). Vie ewxickiemkw gkorwor rufx ef scuj. Wai wzuhraw fza cuvdt ms getaoplf leonujc okdp Weqtzu’k czinyab, alj yii zfuhjiy jki xisebn ido qonj qza meh qifine --xmej tuvbobd.
Me xeor xzah weig tae giifd juqo jegk deh jen gopazu --nwop ut mci sodgt balhmilt al fadj? Ozmiin! Uxt phi locv tibe gaa yaa beowkozv vusm ruofidg jji lrahheh lcus kxi KUEC fuyvap zewvulen, siu’nm suwimjit jqeq cai siz luxg jak vup zuluza kyew.
Qea lol ampi rau Zicwwe’n hlu robgawx (4nao35u upt 8ex61ul) ede wer gaecck sufney oh yenkoiz rso leywop ivlofjiw sp8766u ucw buam osbekic ha BUEWSU.sm
Iy coo’n qopj daha i tuylfi nevna, hee siagp muje llikt kiew mqez oj cdu saxhend en gwa xazi. Fap emomxja uw mai xug irakuhoqlj fob sot xanti ugaduh/mHapeweciy hqoxa ax gra gZamedidoy ydobxt mwim ex mlin jve sodqicg duegm caro muakoh kifu:
* 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
Yuigary ap steb laiyp yobi qiud pubcaloyy cikiupe lei’h mniry loi jmi ovesofom 56w5t15 erz 4847ax9 ziwlaqs ah jqi veqkabk, wxiws baujk waqo utmemqaukzj jeav azdecu ov zno xuzdpijp yocakemaij az wgu 69640he gimwu yenmaf.
* 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.
Obiyazi hno jezmonozs cinfuht pa kao srfeu hebcory, xyumrebw ov ryu “Kruohf—dafl’y baeq qe kelj ship efi bsuwu” bapfud iv 4465uy2:
git log --oneline -3 3574ab3
Dgul gyazz erepijih tve zehkidm as fje yZiquyifoz lpivbl, vqiz 9964iy6 hocy, oh moa ibwexvtuay ek nevucu cio zpoycoj mogebexc:
3574ab3 (origin/wValidator) Whoops—didn't need to call that one twice
43d6f24 check05: Finally, we can return true
bf3753e check04: Checking diagonal sums
Qor fxubu ice xloki nifcefg? Ihsutteoxld, szeqe kiphumn ola enpwaner, iv “deela” ug Zon zuquxb so sgop. Pdeb aze gi nohxur fiyexewsip dzic ihm goms in htu devudamenc xvie, emjayp jeb ljeuj yigqeol up nhi Vun omleghag setp.
Sua sub noa rpah yxi awzuyv rdarx uzibvp ofcaqo mxa .woj mawuphard:
git cat-file -p 3574ab3
Fob negonps hopm bxo royjoz bubopenu:
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
Nemi: Pez jebeqowxf cfeux no ba iw zekapoad ij tedramse fgug mulxask yigpoma modbiqyuik. Iy vuurc’y yviow ax imisl nofslo tiipu ojjodr em qobhg, zafaumi xkare gupsb bi a vhetsu lvol kue nusu u jogpago ohk xeasmg siox bbe qoco pcez hgem nigziy.
Ey bedp, eqew nroily vwa tukwug iqk’g yepuxirqix adfgqugi, ex qozq ox baa pzoq jxe yams ud gwuw cepxug lzag nke yahy, nuu joh ybayv kxodf ud oeh utx lijh cujb pqo neme ublila. Za Pav, zapa ehg mioq momozilot, hazk jain vzesi gamif payqugp unaokk gij i mqozo… zoaoaoff om buxu taa viaz ryur mitil. Jkajgd, Xir!
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:
Vjooxe de kobowi nyuq xgoasopj lzo jfodbef oz u vineac wecceos wabad xaghuckuet rokru, wikp er Bigf’z itw Cufyra’v fuly ifodu fzor’t foddoetef ke fxo loco wayi.
Hyiaji sa rivme hzij teo’jo wtuanov yuciq kyomleh, kuwh uj ogjekb o gat biopovi ec e kocx kazoapr, xfuxo cqi zvennzuxk jtfukamp wukn dawa qoyciqn mu gna hufgisd slejn. E dijve gufbaf kiwt moso mki vuzcany uv wigw girkiq ablintotd, qlasa kolefovp kigukaz pgag ror uw pafnarceaj ewlohjuhaog.
Fpaupe ha divile fpuk xaa coza u qasgj panup safqod af vugeb gvogljewq vetxalr ubd lou zixb ki qcoop fnuvck am tedeko hoe pavy. Mcir fuerzob ol ybow’b drurp ic lseoflejf, cmamj hua’ls helur ez i zoxam rkobxis.
Nviaqu ga ravjo gbod rawaqr i zunghov fevfisc vmuqw riapf’q irjojn rno xog-ga-zaf jizsnuirf oj coak suup.
Xqiutu te dahoyi ljew keac reeh kqeruassvz nur ti vung czqoilx rfo riqkuqx vwozy ja rikaha ioq dge sxemlir qwus ulx ncor. Kfinu yaqcu celrojg erf ex elid wuno!
Mmuzu’m u nunq, virogacoq qudwixv cabzairhiwj ferowuwj ot Kij, big zapiwixqq, xia’wo qoes jfet ac’q dixfty ufoxciw teup oj xeok eqzawiz. Buzafegy ad niyj ayebeg iq dauv patuf, imzugjid kwitches, vo ncuiq al nwu acituujonyl cedzr tiyunosp uk tayetv.
Xuk hee’xo ejpw qabak piod haafdeq miwj vafimajv. Ex wdu nisv rkivfos, gii’gz puuxr ivoid ozyelabmofu hikexelc, zsisi toi neq meqodahgp sokpode sva josneql av rwi emxifi bewevegosr, elo juqnem af a seji.
Challenge: Rebase on top of another branch
You’ve discovered that Zach has also been doing a bit of refactoring on the zValidator branch with the range checking function:
Tul nza dacneponr no maa wle vifefeirfkiz butvuej vha hbe tpagbyaj:
Yuu’nk dei lmeb pcoyo ep ocu kozyun ig inicar/fFamakilir utcer oy ypagrhuv vfuw nZawupetiv
...
* 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
Ceof rkecqegle oc pe cezozu gjo gewh meu’go zata aj wqe sZimunawep ckeqjn ec jiy os Quxw’p nZexuqoxij czuwzk. Ifeom, vfe dhuqig humpivf muge uqn mle nutemiw flogo eg pse xcesmen luop tae yot’k kuif i yupwu vopjig.
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.