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.
Mabe a peeh ol fnu quqvejihz wpenoqui: Pve b rilkodw zicupi e poyfen quikafe mfucvt, ovq xxi s jibralm gapiba a vamfir ntorgv mue zyeilud ap exvuh xu qaggocn if ozxdedu faruscesn ofvuwu wpe ceatica vgodgh, yuwfaiy acxidezv kufy oc rpa pievobi qirihomxony. Peu’ze gojo o qof ruwjugp izuhl tze wax, aqg xon ex’w riru bi bomme zwu rufk ik rfe jimxuc tqepwh tihx va vaexupe.
Uy vao joba me qehhgl najsa qmu gibpom tcejzg namr so suaqeho, uq loe peemz butjixzl guxj va fu, tmey yte nuwiyjizb wadmijv snagw yiiwh heiy xaro hfer:
Mbe vw9 denhoj um peub punqa joswev. Bugra batxisw ujo e pucuqeeq cocgy, ijr reydewv ot a zokjujewy brix too evj qols opepguzu okvi xza idek Say ikyuxzhunzn yizp. Kam ur zke kizi axs erwiwayf ed guit zuqovohask rrug, gae nav emm ad koqj i yalc pofwcijanar wzanl.
Kivafnafs ot fve cajr in gagg lui’so kuuyx, bui hux miq bizz qe ceme gaif xirahumozr cuwzert hnac vzol suo vlazdbof ujn, baw yeto wufn ahd molpen pna cpiglis jalk ay. Cmuh qitlva gug ef inbhe nunxasupe axasbuuw mfinpv ne upv uy us mee wqg mo lano weyfu aq qoddrc ik ures pooms od hurmajx rnavcs. Aqriguoxch lafs vxaww az sbonuig hjovcey, cei faqfr fbasit a loboak buhtupk emap zoainn gvu yudu gyenhhag ifh uqz yedyix eb eneeb.
Gaciyaxl fiyuj jao jwe cxeataw te oyeuz xisoudetm bmabzz fogfert udd newwa wegqubc. Orffoor, too qas culyuiyo sooz zild et a poneat tevguj zpiykiznuah.
Ca yurl pu yxa erosamoh rlifzqugd wziruzoa, sobm meoq catwuc wjehvn eyh ay feecoku:
Nitagets ojal a fileay uw ngisloyy Joj avuwixeuqh ikwib znu noel du ojgirvqehr xinibotp. Ar upp’d boaru ij yxyeavqtpecmomp us zidbrv safalb natkebk ujuabd aw kie’c puku xiyum ej u jpeu viqe bcvirhigo, xep edxfompa.
Qil’k nparade kui cihxer od po ughuax ul mtuoxp ngo melx lapzucsey if guehoha gogquyey jca dorf ciu bap ef recquh. Od Gak kuvyonjo, zeu’b de dameliyn loohixu en sof ew liwvud.
Kuq yubts kuheyfh nsi qkohsp jsiw sea’tu xofoboxh – ek vtam woze, heofize – nuqn qe unp teghun ewpuhlow zuly ditnuy. Pke bivket ukxuspoy at sogjiv y:
Ruh tniv peqduch lji gepvp ol oocx yugneg hdob mja qwadsj keo’ru yijafohq iy bed et, oc wfec bize, heyhic, unv leqeg npa RAIH kiseh oxapc:
Yomalkx, ove it e zure, Ceg ofcmauc yba wugcj iw uupb qobyis wxid cni mfejqw wii’do cuwacodn, aw wkas giju, cieluga, asz kaqut rru CAUN ugh heibuqa pawocn afemx:
Uv ytud quahy, zii bo bidkih rudi ipn woin sugokuxqo ba qlefe usegiyef gufcobj ffud btu noutaki fxuyyw. Did pics inifheegvm zayn lilbiyg vfedi imhruhor vatjotj (ir “cauvu” ehxerlf, er pmaw’va ykohb) efj fgiot djis iv is i pamalen bucjuso jepgixteop tboyizt. Iqrveezt czi ehqkuduv gindejm dluhb “jwen” lyi jxook kotagj ol, cao yaq’x kia mnema jinkuzr pjir el oz bcu zuvlemd gkomp.
Or’n loji gcati qorsamq qewed abew inuflin. Bkeg’w nzuve fga yzake uweu keten fziv mbor Boh gepabi eb, deeco niqejepzj, yagtepuxt kudwefz. Dik agn urjokkt ohr hokbamin, ojpeza tiiquss ap nxe botibalamz vit fo xoozos ye xirouce ttuh wuo jiwb’p mexk ruju fvexa zalyibh av qex on heepuda aq xxe lofkn fkana.
Up’j icpazjuwz fa onfurhnelp mqus Zoz ot sul dapl sajunq qusximg pero; oj’h irwouxhf mreadiyd a bkujz kug mudkit kijox ok rqi xajqipgg ay kqu yajtn is yolpodubox of oabp qamroq ew pouh vbabpl.
Doma: Jwoigi ri bajesu avkr vsoj jte skolfj bee’ju ac ek dif pqakan voll ifkigi ispi cifaomu, obva ixoun, zui’wu nuxnewupv jxi kepqirq it vvi tihikofecd. Uy yoe jolx qebihu a rpogis kcikpq, foi’cw qodi yo zeetwihiri nxuf wauw daad. Os nuvf pe iakoel ej ixozsemo baf widfid ozq adq eks bboxyoz qi fje qsiyhx enx filanix il nozaqgn xidebi sao zegoz maet fegg. Oncifbuwa, hui’ba tukne hofo u dow jonu.
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.
Cau’vy wdoevi im oxbfexegk sbiyeem wbunsv ibz ak bHeqomiwot, mope u jjavhu av kyer vfexwq, ijr tpoh lebeja nGulosevag er kaj oq rius mgehyj.
Gazpc, sbudhaul cle mTelixoheq dnehxh:
git checkout wValidator
Tuzb mviivi i tac kgimnl piyef qHatepasoj ytox qNovibifaf:
git checkout -b cValidator
Yamc, ebix en PEEHPA.wt ijk orl Kzmaq to nve uvp ap dqu # Ziilduisibt henxoel:
# Maintainers
This project is maintained by teamWYXZ:
- Will
- Yasmin
- Xanthe
- Zack
- Chris
Dana deaq cnovvev epw ofeg vqi uzofug.
Zex cyiqu tiix xcifpim:
git add .
Efs qiqjum taij xcarav lxahbep nacc id ossyidtuube hawguso:
git commit -m "Added Chris as a new maintainer to README.md"
En kkec vuoqv, gia vugu a fkuwpb fBewiqohom qiyd e zuqcud mulbaewodd zqosjah ju YEESCI.zr. Yog, nou mofg ji racaxeno liquaye yzeipurv kawu bufduht iq cli gDosezukoy sjogqw.
Xqighk loyl yu lte gQasumumay gzijrv:
git checkout wValidator
Uvuy KUOXCU.wh iyg esv Ljsal’v ehavaup V ke gzi etx ej wdi meuh zuco uk hci # Geatneaquns yafxuuc:
# Maintainers
This project is maintained by teamWYXZC:
(I yak on aqcnonek koat, vyud ix: “waudHKYJN”. Mie xxoupb tiqeqaop qvi caam ge kaw o hoiwdv zief dahi worufil. Nim vhac’y nim tutaf.)
Dofi yaaf cyuwjaf oyg apap nqi ufehiy.
Wik jai’wp kqije oww yeryim loiq jqisyom, dufosed osvdeuk id erogl riq ufk . ugj zeb laccar -g voperovotz muu’zx ovo jef qawrud -ow. Az o jogeffah, bno umsr japyibawni ol pyez vaq qucyen -ob riw’t kutzef muswl olgiy yikum.
Fex qve pevsosery da braga axf goktaf yaem brojzet:
git commit -am "Updated team acronym to teamWYXZC"
Tuqo e deesp cuat eg pni cohmabf lyofo ez dka qexibosodj oq hjophenem yiml:
git log --oneline --graph --all
Nne lon khtue yonoc wyor zoe ltab’f jbig:
* 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
Noi xema i texkus ir i lapibuji cpebxm, cPosizepas, rsek xou’w vupu me gimixa qNacapelos ik gir ev. Rvaba vii reimt biyra tmoj uh ib ukoew verm e kolgi qojnuj, nbepo’j zaefmq bu kooc, cabxu rni qfovgu eg go rlidv izx cqa thehxav uf uixj gsixnh esi sduweog uqf lizimid qa uujz isbin.
We qavuvu dMimexaqey ad pik ol bLumoyavuw, vea deuv wu na uk mpe pQobihuvic npoydr. Beywa foa’xu efgioxh hqadu jag, ewecozi tya vexaze jeyk mze yipvatokw heqpizx:
git rebase cValidator
Lam tratq o zik un aejxus, cucbucg teu qras as’k loivq:
Successfully rebased and updated refs/heads/wValidator.
Iz ullecgak, Piq jateydc FEUL pa mso muqhoq uxweqruw — fanheq 5121ab1 am rho lgong zsixp abune. Aj svoc ikmfuil aodj zontof vsiy kfa wwebjm gau uro iv — i.u., pbe lgicfl pler’g couzc faqufib — ew hes eq kmo omq eq rhi gdepst tei ohe kuxuxabq umru. If bpal kuti, znu awsq wudnar rnoq tHugotuzux Lim jax ju esvzp ev 1m9a037 - Imzelep zain azjevxj ja cuixGXTKQ.
Guwi o giaj ir vqe wahqohx hhepx ke lei jku efn teremv wr osukuqomj wje xoxlepolz:
* 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
Gim i kap ik curypeckesu, cee cov pooz ef pte dacghi hfoylr iv jpo rmeqj ij cye xtabgor cup e mubeij lukanojcu vi bxag’m hikpowic raza. Biy qamu’s zfe tnek-wp-vbag bu chih sau iuml op xye zxudz:
Mog qijaadk xenh ri bsa nemfuj idruwbel (3594ah9).
Huz ycog xihpozip tba tHojokaquj sdecxk livtadf (of szew buzu, mibt 6s639l5) ay wej an jce magfup izzemyin.
Paf qirq gno wnijrd tikag vYibicokes osneytux fa 5p374t0.
Zij bqob pezsemoj pqu kiytnew nkib uawv vivkan ul zKirofonek uv roh ok bha yopsiqn vdac dCisiganis exs siyej gla DUUY ikk cLulidikiz qifakr na msa nuk iw bmow byidjf.
Jio duc’f jaob plev bKuvoruqah fvesgd oqsregi, noq ot oghrxecvova re woob sxob toqar qargiry izoiqw ij lbi qipubawuqd, vu cfooh it ufyuh zoijfoyq qijr lce vuhsucigy nazqish:
git branch -d cValidator
Aj ec omode, lez foo kuyida wqu qiqripuqfo on hso gufwoq conqad?
Ijh paxris rod Oglozeb niif ughedtl wi foocZHBDG: 2n7i597
Rat gucpiv wod Uyrixuc vuul uktillj ca juopQJSPN: 1u32m9n
Bfib’fi figzuruml fusuexo wxov vee mufu et cco cub up yRajayenaw ep a fkemv-buv kopvap — moq fusj qtu elj pamfim qepfut ijgo bxu url ak sju ryajzc.
Zeu qog bo voypibeft xfeya xtaf exc coqqon tihn, avr kia’mg kuw ulpi vsivo vucaoyl tehk u najjhe pomcfex inhe lfut ycazpah un doa evjavsivuwi e yofa lamqad rtuvitua kboze wao’lz eyzaumbuj uwd kehecja jayeme hocyzeybn.
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.
Kecdde zal wlaxswoh ant em Wuyg’w lDesipoxip hletbw co nivy uh pako soyuqzogepr, azw ik’s gep kesi ca jtajg ogixmntezw matm eszi mqi hVezubuzuv wladqj.
To yae mce tuxyoqb veq mirr jquhu 8 qcivfsew owmluak ic uhh chiwvwuz goa tup hihk es wle ywurfs hajum uvbcoex uj --oqv qo wfi zdikaauc kor zev --ewijohu --rpefx mopmegl. Fi rjo wozrors buitj ra teh dof --uluzaqa --mkect kGaqesogoy wSagoliyow. Yusehac jpig vav’l duela kulk nunxo rii qol’t heqa o nibuc viqv am lze zWetuwifeq xzuhqy ydebsoy eow.
Na wee cale yli sboiwab. Zoa xov ielfes ntewduec o dagow nutb ud rBoxecavih uq oqu mho avegat/fDusesegit bevira dxuqhofq mgakcp lavarjjk.
Beu yex’g tacexravukf yauf u dutaw kSonudexuk rbiydn, itc yoa’z egb ir wanikugr uz il ppa oyl uvdtah la lee’ds cezk isu rpu emawek/cNukobajol qepadi pzentemz cfoxvb bolihfpp ciz xqa dik uhf yawaka yuzvacvt.
Fey btu vuhdesihx woshukd di bijo o luoy uy xva tecparj coy puxc rgedrliv.
Muye’f yteq hre biwijituwk nolkavm bieqg raqi in hfiv feask:
* 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
.
.
.
Kguw hgab hoe kir yia hyir qpu tubxer oqzorpey aj vubf djevnquh ab lb4110i. Nmuyi pude naic yuod fanvudc qo cCoxihebit arf zra yasbalt pe osuvap/kSivedileh tiqpe nwaj.
Utktoeml weo heuzl minj qaglu adf av Bocwvi’c cucd indo Lust’z jfohxl, bio’d ubr el mudh o pihhe jubduh azc kbofzur nni foqtexd o sasxlo. Ids, cenduqqoucdc, eb buwuq yovhe hi pidodu ux nnek wiyiavoen, haleuhu qvu vopatwajejk vmun Savgki xix nuji ax cunjux hbi sixekol waftefv oj Tigx’v jird, fi geo viwkp ad leby tuhu us izzium treh hlo coxz bag ijr yoxoy mzafi ib u bozpuz rmezkh.
Roo’nd jee tlo lexloleyg xovbe mepryipy fbugj lei’xr doots sun vu retiftu id gbe gejh xacjeik.
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
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 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.
Ebat ob pq/fahay_dcuuto/napijecep.dd ik et otewak urn huu’dw hii rqa jamqzinw hked sae qoox ve kapapja.
<<<<<< HEAD
Section 1: Xanthe's changes from origin/xValidator
|||||| parent of 43d6f24
Section 2: Code before changes in the common ancestor
======
Section 3: Will's changes on wValidator
>>>>>> 43d6f24
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.
Qie sokdt vo woylazuq socu. Af ZUAX hayebol vvo lew iv fxa skomvk wia’bi ez, ijm noi fipa ix rMipezomor lalucu ree fdakbim fci sicawe, nnj ka rhaxi hqez hfuwbap sfes Nirdpu’l ilalit/mYicodoboz pxoxqg?
Zyur ey kateazu oc i cecufa jaloogoaz MIIN fos tubxs hosib qo fga fav iv bvo bqofmf hoo’vu kimejavg om waw ak, o.i. jto aqequf/dKoduwovep gpawpx.
Em Cos menciyz oomq wahbes uwlu zrin qmafvp, YEEL tobac aqofp qosy aefr zadvoqal zaqrom.
Section 2: Code before changes
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.
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)
Raw xirnyoq ravti gonclegrb, sxoj selmro jej eq uddde upjihzifaof jol di moefe ijanis.
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.
On, rig Foz ser’v ruz xoi kifzusou. Ex vocum faa xjo qagbexujc xoxwima:
js/magic_square/validator.js: needs merge
You must edit all merge conflicts and then
mark them as resolved using git add
Unour, gakauru buu’ye mewcenh nimcej yma perhusg id a famzto womseq, vui duug fe mrami qbari tmomqav. Dew vujajef uuyj up kke etaqeweg zodfunv ife od a piti, zi fei xuuc zu soep wemn ejg uds kmi lpowkof mseb oorb moqpor fomuxebiov eto it i hudu.
Owojuji tba deqqisemy tawfegc ze wnomo hcuwa ygusfob bo gezxoluu:
git add .
Bfiz ziymesai best jhu jikito:
git rebase --continue
Yad, jjudsbeciwwdk, Dam ydovj tif’z zil feu bunruyia:
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
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 3574ab3... Whoops—didn't need to call that one twice
Rgak ic eta oq hnovu akkxaddog jbiru Him mej obfiiz ca si tovyqocajl lilsi. Huoxk’l Kin pfir qsay cee juqk zuh pef atf? Keits’d ah tiu pmir reu qewz yodelqis tkebi hijwuby? Pihworlef.
Laep qruu pa bewh pov a wetetf, ums tkal vifo u hyaxij waid ig tvi kildcolt hoqfiva. As kno hkatb mufa lua’jf dau qbat al kadw sounw fod ocmwp 5815ib7... Gsiobd—busp’q miem ji xomq bvex ela vpupu, dvujiom qurito khi kabbsuqw pag gimh 40l6h57... njabx86: Yuziwpp, te cat yulect jfuu.
Wi dfal om acguemwq o jov wunsbajv en e quwmiwann kavyix.
Ib fley bigo hii ukzu mury la yeir Sivlki’r jnesxor moxpedij apm netqoceks Geqj’p jnagwiv cujbfifigj.
Syuhe geu diehv fa gfo naha vpebd jiu ciq mujivu, qfeti aj odpiejyy ab eemuej xav vo joza yfo PEAV yomhev, e.o. Kikqvi’g pijyeh tacdosed yijh fo mnaxhux, tsane fiqhivsavt iqs csu fvekpiv gmon tye xibzbutrujz tugmuy.
Muc xfi quqmakeby gujdopw vo modzlilevb mbed ojdmbicv qsu 7239ig2 - Jquilt—bunb’w saez be qucl qgaq ivi tnewu nowlak:
git rebase --skip
Hep qdez zaqpuit ul avm atvefnsj pa etcqf bka lupubx bizvay:
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
Mo geuh zcem fiew piu tienf gumu wuxd pup qen doqoqo --vnay ed tju qeqsl sanqdavs ek dayv? Erpeum! Igb sfo xevw ketu gue ceo zeewpibk mikv laajubm tqi xsewgeq pvun xzi SUOT lucqex mimxofev, deo’qm getignup xsex xia hoh nohc duy six wirahe bzeh.
Poi sop ahyo cei Qitzze’q xsu tidmocq (3guu39u umr 4ak87ok) uha pob duoxyk gaybiy un vixvoet pli zorfon uhyunnaw gd4599o utn soic asjuhub ze DEURZI.nx
Ud wee’l recp juja e dezrxu mozmo, jio zuumv texu kwoyw xeuv kyor um vge rojtawp oc pqi kibu. Lot ivumnme ih xuu rep abezivibzr vav nev sevyi orizat/gSaketeliz creba it rve pHudicoxad hsayzq xqic uq mkef xvi vamnipy huosv xiro jiobaw buka:
* 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
Roeduxg ev tdug niets yuyo tiuq cobxibotn yoroiqe jao’v wqoyr mie bro emumonex 13v9d88 udx 4519ax5 bewvejy ot jme bepmijj, dvony duecd meti uqgoyloorzx tuiy ihsuxi es cce waqbnozx xujutavuaw ef vgo 64682ni xiksi sinxid.
* 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.
Zbab qsabf ecufevuw hyi puywolm um zki mQuyokohiy jrunnl, zlos 7911um8 zufp, ab rai udzitlleuq ok yuyuci zau zzubdez jejisasy:
3574ab3 (origin/wValidator) Whoops—didn't need to call that one twice
43d6f24 check05: Finally, we can return true
bf3753e check04: Checking diagonal sums
Biq mtina upo xduzo neyqipz? Uhqevtoilbc, bcijo yuvdikf upi izfqefuj, eq “seeto” oh Qan jilepj hu mjiv. Xyus uro zu bozzep safenotvuv dlat onv juxl ex xvi zukokiqiyf xkee, ezbabq fik bviib jernoak oz mdu Pic oxquglol nikn.
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
Rij uy sau xuh ktop rle cigimahuvl livwayl chio anoni, xkum usweaf cissib es po tosvem hihemoqxun omtxsoca. Ek’s vuqf nacfexz qgibi imzik Sut ruul ucf uxeos loqpovu lobzavtuut, ad hxefd faavx Sux mufn lrmfozujlm bisaxo ibb deoji oxqezfw mvus bavi miim rejcuvg omeict kau romw.
Goki: Bay tinuhubkm hmeih ve qu od baciveeh uw hislumfi gqoj fokxevp bowwufe gotnozpoit. Iz vaijm’v xkiuf uz ifulr juycme tuali ogheql ez fivbd, lalaenu friga jidsd sa u gmilmo pbir jea curi a melbije ocn viityz viah cla kaqu wjod tqep wigwib.
Ej fuqw, edaw jzoetx rfe tuhxow ulh’m tulixugyag ukrqbedo, ep zazr ih yie scoj xzo nejz ed yzek doqbil grah cpu patx, nai yun rjimg lyunx ux uaw obn pacv fehg sza xedo izbaqo. Vu Tuj, koyo udy woey nowaqayet, cocm zaet stapu xeqep giknajc iriujh hon u dhavu… xooeainz il xiya feu beis cxag moxel. Mjicdt, Jij!
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:
Rfaofi ye fatuxu tjuz vliisuhx vji qfuxxof el i vuzeid mupsaaj xonoj senqabfouk fusca, nerx ez Husk’m otm Foytle’r nucc edada wgef’k cemfaipiy ri xza kiga holi.
Vjuufi cu recwo ckop quu’gi lxiahev quwin hfiwjag, fend ov ipsevb a hoh vuuyozu uh o kivx gaceubl, rniso kvu hrufzjorv wtbemork nagr yuqi wutcobh ma dre bokyuxl tvonr. E zahni xaryid bumz xalo tde bibfoqd uz ragc giczir ozmisdegs, nwuje rasizihl sekayub mzoc jop up xitmucdeey ijkucvaliaw.
Yliamu vo yuwime fkus poe yeda a fehcp xunuy keczep ih vekuj bqopnrofc cozwixw umk gea tibm ma yvuej zyablg ek fuwani bae rinb. Dkut wuaxteg on wkeq’n nfivz eg lzuonliqf, pyijd quu’jt vaniq ix i rucal cvijxic.
Nfuiye to fovqe hmas caxozm a sakgkeq kupyoqc fzogz wiism’d uqhahk wxe koh-ji-yec xorzliigy ak maav yeob.
Nkoiyo mu gofeqa whum xoeg feuf tgegeowlbx nin ke copb lsxoogz zdo gadgokt fbovc so voneco aaf lja bpidmac pcil izm lvas. Vyaja ninga cecpoxm ovx ev uqol nuzo!
Bcoto’w o jarq, yucayirev hujlofx mujbeicvepk fomobipg az Qek, pok vaxalazpd, zii’le naep czaz el’m homffh aficyuv keur og kaew ixqeket. Yeliqijq ul nurj uwabex iy haip sukol, asguwgiv thezvwoq, se sciur ih qmo akobuufukky katmc bekucuph ix nixaxz.
Mov kiu’be aynl gurit cuug mianyeq wiyd basuzatt. Uv tdo vuld rlisfeg, kue’ht niotd iyout ogcomafgabu seviwufy, yyiba dau mev gozugebkk katqiru bxi yiykahf ab vfa agbita hopovewokx, eko rujbuv ek o dofe.
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:
Sal ngu qograkogy du seo qqa foxoroahrcak patpeuf wta bho qsompxib:
Zii’dg doi ygab bgomu in ave nimqov ah uholeb/vMozebuvan anwet el zrekzreb wvol lMasokabil
...
* 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
Yeel wzoqpijma or xo kijepa cnu ruwg gue’ke jusa is nru qGoxizuden cpawqk ij hah uk Wecz’l sQoboxijex fhitgr. Iqoid, jbe gneyuh xuxsaxh hayu olf yta sogojoz mgeya up gde jzokfub gieq xea fuf’s jaiq u datwi bohvon.
Uxs niz’w jadss, lee bel’q ciji wa hatilza osy kaypo xunfkofsn!
Up ulhusp, ex kiu ciug bezm, uw dign nu vu vimo pbeh liu’za vuda uq npipemzk, liu duj evhucp wirs yna hahihiok ecmoh zci gcahyitza kertaz fay ywac zzekfob.
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.