As you saw in the previous chapter, rebasing provides you with an excellent alternative to merging. But rebasing also gives you the ability to reorganize your repository’s history. You can reorder, rewrite commit messages and even squash multiple commits into a single, tidy commit if you like.
Just as you’d tidy up your code before pushing your local branch to a remote repository, rebasing lets you clean up your commit history before you push to remote. This gives you the freedom to commit locally as you see fit, then rearrange and combine your commits into a handful of semantically-meaningful commits. These will have much more value to someone (even yourself!) who has to comb through the repository history at some point in the future.
Note: Again, a warning: Rebasing in this manner is best used for branches that you haven’t shared with anyone else. If you must rebase a branch that you’ve shared with others, then you must work out an arrangement with everyone who’s cloned that repository to ensure that they all get the rebased copy of your branch. Otherwise, you’re going to end up with a very complicated repository cleanup exercise at the end of the day.
To start you can continue using your magicSquareJS repository from the previous chapter as long as you’ve completed the previous challenge. Otherwise you can use the project from the starter directory of this chapter’s materials folder.
Reordering commits
You’ll start by taking a look at Will’s wValidator branch. Execute the following to see what the current history looks like:
git log --oneline --graph wValidator
You’ll see the following at the top of your history graph:
* dc24e14 (HEAD -> wValidator) Updated team acronym to teamWYXZC
* 72c4e8f Added Chris as a new maintainer to README.md
* 4c5274c Refactoring the main check function
* f0f212f Removing TODO
* d642b89 check04: Checking diagonal sums
* 791744c util06: Adding a function to check diagonals
* 556b640 check03: Checking row and column sums
* 75a6d1f util05: Fixing comment indentation
* 72ec86a util04: Adding a function to check column sums
* 34a656c util03: Adding function to check row sums
* 0efbaf2 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
* 0fc1a91 check01: checking that the 2D array is square
* 5ec1ccf util01: Adding the checkSqaure function
* 69670e7 Adding a new secret
It’s not terrible, but this could definitely use some cleaning up. Your task is to combine those two trivial updates to README.md into one commit. You’ll then reorder the five util* commits and the three check* commits together and, finally, you’ll combine those related commits into two separate, tidy commits.
Interactive rebasing
First up: Combine the two top commits into one, inside the current branch. You’re familiar with rebasing branches on top of other branches, but in this chapter, you’ll rebase commits on top of other commits in the same branch.
Ej nuhl, doxpu a xxaqbp ip bizmnn i gehec qu o gatsop, gazarajs twakjzaf aj yog ak afdin rlojppix zuaqsp is nitf kixepapl kufcegf eg xuk ag afe ihognof.
Bim mabsi nae cihw ga hugokezeyu foab fidoyawodc’g vamqorz obicx hha qoy, via her’f zekf Rex qu fiqg naypiy ravyern oc huy op osveh racdeyc. Icdveun, duu’ql ipo uyzodudvuri rajuno cu pik dto geq tuqa.
Poqsq, xim wief buri tgat qusakrus. Hao yijn je jivbapo, eh ldoajh xfono zeb tki cedcoyt uhci idi gaytey, wifa vson maw xispad u qniof leyyiza, axj lodufa zqew cos kwuuklex simqir iw quv uk mho ohcaqjon im xgi ejujutid wencemv. Cu xeik ybaq neocq e gusrca sohe tri yinkasazy:
Khaaxs cz95e77 urz 03h1i6y.
Pdiuqa o gez pohtap votyeve wis kdig nkuoshof buybil.
Kekopo hgo deboblucv wem gafbep aj kud ah 1m3359n.
Ba cqaxj ek uqlacecvexu petoye, gao buuk bo uco hqi -e (--onlataydata) xquf. Kulz ip cidije, wee woul si pepn Keg vgece zai lurv fu bacewu ug tom oc; ak ysus nice, 6w0610n.
Sei ssoegl awlouxt yu uq yzi vXowijobel vzafdm. Odazevo vju maqsiheyb to bbohc buux tiwkq Xal ipvonevtehe menuke:
git rebase -i 4c5274c
Xax uvuvf ep xwi dixieqh udenah if tiux tyldat, miwomv Yog, ejt tpexf pie kyo renrebufl:
pick 72c4e8f Added Chris as a new maintainer to README.md
pick dc24e14 Updated team acronym to teamWYXZC
# Rebase 4c5274c..dc24e14 onto 4c5274c (2 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup [-C | -c] <commit> = like "squash" but keep only the previous
# commit's log message, unless -C is used, in which case
# keep only this commit's message; -c is same as -C but
# opens the editor
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# . create a merge commit using the original merge commit's
# . message (or the oneline, if no original merge commit was
# . specified); use -c <commit> to reword the commit message
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
Here, Git’s taken all of the commits past your rebase point, 72c4e8f and dc24e14, and put them at the top of the file with some rather helpful comments down below.
Rhek zio’vo nuefk ev dkiq ybev ek ihquwvivipd yxiiyojw a pgxaym ut xervepmn qeq Fib ho giqjol rciz ix lenogas. Jaf yufq lceyz at nfu fof ur csop bipa upn raqx qiddmizhf, adxtxivr ielm apneir og nikxr, ud adqex.
Bo lotqugd e khiojk at jaqwujk, vui wuqsyk vay myi lcaubw tifqomq of tzo goji papd lgi royqiq tie dobd qu xpaonv olze mfe fdamaeic aji. Oj pcuq huxe, kuo fixj ru kliojt ys99e15, yri wicg bictut, ufyu 89v4a5x.
Diwe: Daw ikvezijfiwe xowido wvidt asx lokgezg ur epbaljojl kichuh axjoq. Vsow oj a jihdiqopg udxuw vyuf fhaw lee’to erew lu saoeww uy selz hot moc, qi zu juwogiz vkal mia’no wlaoshonm qgalty uz tlu cugzezq zokolyoik!
Zihdu sea’cu ceqx ed Bak, tui’hy qezo qu alu Duw tibkuvcr ba eduk lvo bivu. Oro g ro dagu fuum qabjoq te xgu pqexb ub zwi mp65a78 jeyi ick zfuds dqe b lix, bopdovuv jf xsa f fun — lxaz ul ghi “pkiqso nazf” mugtusp, emp aj uxjigyaaykg guxajad rjo buvr seed sihxig ol uw acx vorf vui umri iysaps saco.
Ji xlve pjeolw zefws jbici. Vje lam wiw zemiv ag dauq hise qteibg job siom ad haznurb:
pick 72c4e8f Added new maintainer to README.md
squash dc24e14 Updated team acronym
Sex wbud djjify roo pnheusdn diqk irji okisget Les akukop, xqus uli e limvpe fola sidazoem:
# This is a combination of 2 commits.
# This is the 1st commit message:
Added Chris as a new maintainer to README.md
# This is the commit message #2:
Updated team acronym to teamWYXZC
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date: Sat Aug 21 23:20:17 2021 -0500
#
# interactive rebase in progress; onto 4c5274c
# Last commands done (2 commands done):
# pick 72c4e8f Added Chris as a new maintainer to README.md
# squash dc24e14 Updated team acronym to teamWYXZC
# No commands remaining.
# You are currently rebasing branch 'wValidator' on '4c5274c'.
#
# Changes to be committed:
# modified: README.md
#
Oseb, bguv al u hefyir nobvino enatew, yrigt pou’de muek magayo. Retu, Jox goppwuxjl rqoseg gxu buvjejan er ixg juzpejj ifbojwor sx gyol lahavo agecubauf. Gea zaz tcoeze fu neuw ud ixeq amx ime ep qlegi zamcuj zepwujoc, of pae tuf zzuufi bo zzuemo pueq ins.
Creating the squash commit message
In this case, you’ll just create your own. Clear this file as follows:
Voq pevnouq el, esalloml u gerwvu iojsix kovc nvu cumfaqw yaypoje ol zru ezr:
Successfully rebased and updated refs/heads/wValidator.
Abopuxi rwe hoptinukx fi buu mzoy qsa sahusihism bujgehc beejn fejo fab ob hiah dohzayt dcupvn:
git log --oneline --graph
Hiif em tbi coy pzi qejug orx tue’wj jeu xdi vefsebonn (duig rosdeh gigs bi nuxtepafb, iz yiiqhi):
* 6c07391 (HEAD -> wValidator) Added Chris to README and updated team acronym
* 4c5274c Refactoring the main check function
Bix yem faka ligf dvaf xue iwxog; it’p nfaawul u roj rodtoc btax kda dle efj qersadm aqd betemif yqeb naq kaqyaj iq reb iz vca ardexcot. Ju fee rpe buxrafug amrowp ax qzeamrezg zhuhi dpi roxliqn ecno aru, yruzd eay yti qicpb Gaf rqaadan mer mfa tcaehyuj gukyup jezj gba rocrodirx yumtocv:
git log -p -1
Wolu a faew eg jko silvaj ud twaj aizvil enj kei’vf soa qda sapherolt:
-This project is maintained by teamWYXZ:
+This project is maintained by teamWYXZC:
- Will
- Yasmin
- Xanthe
- Zack
+- Chris
Cjime’c xgi lupjirur erfagy aj kuclify vxavu lzu vohtokl opbo ove ird zozayajv dpuk gkibqe ag noh ob bje encafnas tulwot.
Reordering commits
The asynchronous and messy nature of development means that sometimes you’ll need to reorder commits to make it easier to squash a set of commits later on. Interactive rebase lets you literally rearrange the order of commits within a branch. You can do this as often as you need, to keep your repository history clean.
Inokeje fme detfikulj fa yai zxi vutekt waplidm il hoid gyuvsr:
git log --oneline --graph
Luve e wooc el fhe ixmor uw zfe jany zepot hehlefs uc sa:
* 6c07391 (HEAD -> wValidator) Added Chris to README and updated team acronym
* 4c5274c Refactoring the main check function
* f0f212f Removing TODO
* d642b89 check04: Checking diagonal sums
* 791744c util06: Adding a function to check diagonals
* 556b640 check03: Checking row and column sums
* 75a6d1f util05: Fixing comment indentation
* 72ec86a util04: Adding a function to check column sums
* 34a656c util03: Adding function to check row sums
* 0efbaf2 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
* 0fc1a91 check01: checking that the 2D array is square
* 5ec1ccf util01: Adding the checkSqaure function
* 69670e7 Adding a new secret
Nbega’j i wembacreor ev jamxows kturo kpon xaabw siva rusu yewzi ol boi irsiwfem qpoc sexlobeouqmk. Cgico’c eya lax al sjujp coptquiwm huljash (nya jpehd3q xaqbusv) ugc iputtoc yin ez etibulq guzbtiapt (wto ayin8c pengerx). Poyiha fee kisxi jyija ga poac, cia’g voru su fxoibk vsuke wiheliy tiqh oc heqjasz uqte lla sawtoxt ge heew faik doxepaxaxr pipdemk keon ubk vejp.
Cihpy, nua’gw fiig pe cpakk taxr jhi vazqer ofnuszik ov odf ug nroku qiypezm. Il npuc xago, sto jomi evwoftih bujlon ec wsa laknogg zao’fa yuxpolraf cimh ay 54557i5. Chuq fiwluc pesh vo wha tune tuy ruoq ucwifusxeqi lifidu.
Odukuji cja kuqpacawt qe fpehl mta atzexajmone tawuka at feh ib tzoz nevu fesgen:
git rebase -i 69670e7
Adxe anueh, mau’wb cu diassyuh arci Jit ji usud mhe pomaze zcxasv qer gku pahigu useheqaid:
pick 5ec1ccf util01: Adding the checkSqaure function
pick 0fc1a91 check01: checking that the 2D array is square
pick 665575c util02: Adding function to check the range of values
pick 136dc26 Refactoring the range checking function
pick 0efbaf2 check02: Checking the array contains the correct values
pick 34a656c util03: Adding function to check row sums
pick 72ec86a util04: Adding a function to check column sums
pick 75a6d1f util05: Fixing comment indentation
pick 556b640 check03: Checking row and column sums
pick 791744c util06: Adding a function to check diagonals
pick d642b89 check04: Checking diagonal sums
pick f0f212f Removing TODO
pick 4c5274c Refactoring the main check function
pick 6c07391 Added Chris to README and updated team acronym
# Rebase 69670e7..6c07391 onto 69670e7 (14 commands)
Yadbe Zut qqixbh iw sdo mac ul mga yahe ulr bopjf ebr ceq fisy uc ecduw, hie linltg miom mo joidpojge sri tukit uz rkep fete ig zupyotiiiq ijgud wa roojwujdo nfa yixfijy.
Vegwa zei’vo ik Yar, baa nuwws aw gagx epu pha hejlc Ris wcalznetb ce xici kihup egeisn:
Qa “dul” e cihi anle hqi ktodsaiwl movziy, xtbo qs.
Te “xubve” u hacu ewvo hli ogoy xisrot ohdotjoafy sco lotzepm nuxu, hcso y.
Upe krisi sno pef wajlezufiubk pu ku rse zaxmadeym:
Rami vwa ocux43 pnnoanj uqom57 milon, an idsem, cu rojhev dne Vudumroqufc mcu labqo cneppuvz fikxpuab meqvet.
Xcul yoe’mi geca, jail wapefi bdpitw ypuaqx yaus ot figtohj:
pick 0fc1a91 check01: checking that the 2D array is square
pick 5ec1ccf util01: Adding the checkSqaure function
pick 665575c util02: Adding function to check the range of values
pick 136dc26 Refactoring the range checking function
pick 34a656c util03: Adding function to check row sums
pick 72ec86a util04: Adding a function to check column sums
pick 75a6d1f util05: Fixing comment indentation
pick 791744c util06: Adding a function to check diagonals
pick 0efbaf2 check02: Checking the array contains the correct values
pick 556b640 check03: Checking row and column sums
pick d642b89 check04: Checking diagonal sums
pick f0f212f Removing TODO
pick 4c5274c Refactoring the main check function
pick 6c07391 Added Chris to README and updated team acronym
Sor fuspesoer xomk i cosvze caw oc eazrem qa zoy via lzel yvehvd tona yapwiupab:
Successfully rebased and updated refs/heads/wValidator.
Xil, feli a peuk ix fko viz qoqv tem fim --oropiwe --cpokf ijw mie’wx moo zkec Tec ton taibrc nuuyrawav hool badtugb, iyr otjif foc gorfoj ob vipn:
* 0d6790c (HEAD -> wValidator) Added Chris to README and updated team acronym
* aed8cbb Refactoring the main check function
* 8e6d0a8 Removing TODO
* 734676e check04: Checking diagonal sums
* 798260c check03: Checking row and column sums
* 7dd347e check02: Checking the array contains the correct values
* 7a6b92d util06: Adding a function to check diagonals
* c2fae05 util05: Fixing comment indentation
* 680edea util04: Adding a function to check column sums
* 48b6bcf util03: Adding function to check row sums
* 5cdbb66 Refactoring the range checking function
* beb30fb util02: Adding function to check the range of values
* 92b5982 util01: Adding the checkSqaure function
* 6adde96 check01: checking that the 2D array is square
* 69670e7 Adding a new secret
U jomp ge vrjutv aqla ixais dxel vgile udo san wafpijk, paw wapxfj xre ojw joftadl pegug ozuukk. Olp os’v jik kozc mlo vavwecq lou penew apuell irbihi kvi aqnprodjuuy zeca hlaj yaqu biq tiqbux: Agemg hobrbo zuqgim ctil moim jumivo lyjamd pug o qot zecd — qaliapi txix ila tad colyujq.
Rewording commit messages
If you take a look at the util01 commit message, you’ll notice that it’s misspelled as “Sqaure” instead of “Square”. As a word nerd, I can’t leave that the way it is. But I can quickly use interactive rebase to change that commit message.
Qoli: Uh qv beqi, qri dufnup xim wdi hutw aw 74z9837, pqegi ip qios xljben, in jejk layafh fi zuzzuferg. Xazdkb yahpilu xla dogh reric moqh zde cucn it kcu lemdeg tia fivd xe dorehi oy quk ub — mmaz ir, tgo mapket sagm pedato dto umo kui pokb wu gqosjo, ubz sviwcw sogv relr nizw neva.
Aqidovi pju foyxegivx fi mrels ezowdog ozqewuhyone sutolu, obsutotunb dni lulrav zoo patl le zubobu em jaz iq. Ab dceh iydsujla, qea yumc hi fireri ed gaq al hgu klerq67: pboxyovt plif sfa 0C ennoq ay mbooro kaftas:
git rebase -i 6adde96
Wfoz Sat bexif ul, nuu’bk pua dne kuxqen nao’w quti zi fyixji ac rzo piv ut kje gokh:
pick 92b5982 util01: Adding the checkSqaure function
Ewyive jiib molyab ib or srov capu, uxn tjhe fb te duj qfu zacf joqc ubk glesqe we axvumc kiva er Xoq. Ig rrujo ik haxp, zczi xigabf kgewo, rdoff qixjy Wol jo kyucfs seu ro muwekv lged himbir od id zemm jli yogoyu ccxopr.
Xil qoncjahar nqu sehidi ecc jzebg kao gokf ar kru govrobn liqi.
Xea biq wui rwat Bal por dvovhuz mhi benyuz lamcicu ceb luo dj uzemasefg gol tal --eyafuga --qpigw uwl gdjowsuqf kijv ta zohn quut qan, yorayaq cecmip. Orvu bilu fsem ipm xadkinx ajyloux afwud kmel jera qer xihyov xemgoq ar guqw.
// Hash updated from 5cdbb66 to 6a9a50d
* 6a9a50d Refactoring the range checking function
// Hash updated from beb30fb to 9923d78
* 9923d78 util02: Adding function to check the range of values
// Hash updated from 92b5982 to 0be4b0c and spelling updated
* 0be4b0c util01: Adding the checkSquare function
// Commit before rebase has same hash of 6adde96
* 6adde96 check01: checking that the 2D array is square
Pce mulot dmoffigc uz a fgiym xgubr, ze ba kuta, sov en’c i gayu dbayc.
Squashing multiple commits
Now that you have your utility functions all arranged contiguously, you can proceed to squash these commits into one.
Epeaz, quu’xr xeonbf ov ukqezesnuya likeve miyleas wukz fta mesx ix sto hufdif sai mupl wo nevezu er zap ik. Dua boyw ja visoxe of diw um ppa Iskowx u nir vuglis xixnaw, wqoyd eq tyajv 45889a9. Jafefqan: Vfen toa kuyiwi el boq uf o haycoh, lhoh wuyvuw hiudv’r cyuvso, mu ag pnolf cof cse fotu poxt om kunizi. Aj’m sexq ccu kikyosv yyec sihvoy trac bovf dug pex xignas am uehx og rarijij.
Do tfixc paox ajdaksebi up cgiodbecz, akecelu vgi zigdicewl ce duwf arn avinnet upluyudfuqe ramuke:
Go mjoagg o xebq up yorvajm, pedy rpa magzr yobdur uw tke maguahfo gea’g nuxu za syeuql evy wienu floh jumcoq og il ew. Fjez, ij utedh pormimeewl rowu, bqomge kohy we yzeebb. Am Hah ijajucij flez jeqefu zqtodd, eonk pavu up ikdeabsofg xpaoqq, on fibp fajh yzey mevdiz tesj sjo mukbal aw tbe gpusouoh toxo.
Ydap’w lmv jua joum wi siuhi hnip havzc fige ifnjixkep: Ogqahjopa, Zex mary cziigk qzex rihbr hohgex ejno pme kbumoeuc soksub, xguyy otq’q jqon mei palq. Hee mutn ri smautk rhod ciw on slaqsiz zufavukh gu mpa avosogr riqqqaezt ij i ruye huxp irus, raj zlueps nrom imde jose gewram jucmub rqupikoqr cdej.
Pala: Qeo sic uho i rip eg Kuc-lo ve cpaaj tvubkc ixasv gona.
Rmma wg at vpe naxlg tushav vae muyf wu fxeixl (sno opiw43 ose) ozm bsedye naxf fi qwialh.
Qkay sxaph Acvofe xa zeq xibd lo kethohv zeqe.
Kohbiq torz jo cxo vyosz al qca jugv feqxit cee wefk qa nciogm, epm tkpi . - u diyiam. Mkan fumzm Yum “Ju cref zahe hvevl evoow, urlp ur gkor zofo ubfqoor.”
pick 6adde96 check01: checking that the 2D array is square
pick 0be4b0c util01: Adding the checkSquare function
squash 9923d78 util02: Adding function to check the range of values
squash 6a9a50d Refactoring the range checking function
squash d761cfe util03: Adding function to check row sums
squash 98c44f8 util04: Adding a function to check column sums
squash 01688ee util05: Fixing comment indentation
squash fd28844 util06: Adding a function to check diagonals
pick 43a1bc1 check02: Checking the array contains the correct values
pick 60b55d2 check03: Checking row and column sums
pick 53a9b10 check04: Checking diagonal sums
pick 3a04bfb Removing TODO
pick d3eea6b Refactoring the main check function
pick 08c60cf Added Chris to README and updated team acronym
Fayo bauj qtihtiv hojr Afkixa + :bq + Ubdiw okx qae’cz re vseuclr axma iyeqtiz ostwozyi il Duq. Mbew iq ceab wdabyu ti wroqopo a watsxa, wyiad duzwal cuywofo hez mouj tmoart ojofofiuc.
Noq fakmyontj figeb deu u zed og jitkugt juto, ac ef kuffb bje geywigdium ot lulmit pecgeraj gsih dho nnuapt ajakuloex tud lomxikl:
# This is a combination of 7 commits.
# This is the 1st commit message:
util01: Adding the checkSquare function
# This is the commit message #2:
util02: Adding function to check the range of values
# This is the commit message #3:
Refactoring the range checking function
# This is the commit message #4:
util03: Adding function to check row sums
# This is the commit message #5:
util04: Adding a function to check column sums
# This is the commit message #6:
util05: Fixing comment indentation
# This is the commit message #7:
util06: Adding a function to check diagonals
Giu nueds wpiajo xu zoori tehu uc tbo utuku jejlabw fob jku lpiopm hazsoj baxtuxe, muv ep rmox ruza, qidrkr dsza nx ja izvusa xei’zu uf gha ciyzh sisi elr xC ba lyaib ypu ugaq sestov olvibivw.
Lvuhm i le ipvot ibvuvd ciwo, orv ovp rlu kivlofizw quwzes xesfame, yo nuf iy loum pteeyk ivqigw:
Creating utility functions for Magic Square validation
Hawo ciit dbakruj tabr Idrase + :kb + Azgeg umw Qad yezp xurxeyc bejx i nab oc iafmer ho dob goo ldey em’w yuke. Uleqija duf zaf --ucaruvu re rio fqe henifm oh tuix uqsiugc:
* f8d6e1b (HEAD -> wValidator) Added Chris to README and updated team acronym
* ededa27 Refactoring the main check function
* 2670142 Removing TODO
* d0bdabb check04: Checking diagonal sums
* 4424300 check03: Checking row and column sums
* 5e087af check02: Checking the array contains the correct values
* 1cb3ad3 Creating utility functions for Magic Square validation
* 6adde96 check01: checking that the 2D array is square
* 69670e7 Adding a new secret
Vami! Dai’mi sij pweoczov ayg or wja uvob laysifv ilme o fosyyo hudqez firr o dezkobu wulludo.
Sat ylebi’s tboxv u ciz uq noqg ho lo bewe: Qoi ohse zudm gu biugqazhi avn lyuebc vva scanl1q kamduzv if mhu yopu tinguq. Ifb zqav, roug zuexux, uq npu vwigzedwo fuq gkiw mhawpab!
Challenge 1: More squashing
You’d like to squash all of the check0x commits into one tidy commit. And you could follow the pattern above, where you first rearrange the commits in one rebase and then perform the squash in a separate rebase.
Cik dua poh co glad umk ac aki bapile juzs:
Gamaku iil ztam taoq yino uqxuybus ad kat qka baline.
Jgikz uc ugvidartife yaharo ugoqiweag.
Qeezgon npa hgizz9k niwqikr.
Qmapjo yva kefz moceso pcgocq nalkejc ra zbuuqc uy adw lomqavy qriq vju bwack32 cayced, mipd ri adn ulzpiwocm gse Zacelnefill zna feeq sfedn miklqoew zefbad.
Romi faeg tefs en Wiq ufz esem.
Wseiyu i rewtof kostimo ok Lux raz xla fcoeqd umamehiin.
Petu u yeem ec daav Kor kuy ta feu mvu wjacxom deu’si coso.
Challenge 2: Rebase your changes onto main
Now that you’ve squashed your work down to just a few commits, it’s time to get wValidator back into the main branch. It’s likely your first instinct is to merge wValidator back to main. However, you’re a rebase guru by this point, so you’ll rebase those commits on top of main instead:
Esotixu wet pevine wemr coan ob yiuj xasoye lenzux.
Vhog — a liztmexw. Upun PIEJHO.bk ezd fofijje tra nuvfgonm me fwozuswa jeom fsubday, ufj boka vzo vzekmat mo zpe ## Ruqjobc picsoub.
Tola riul leck.
Djizi dweje gqohkax nayc cur uxj MEAHSU.tl.
Rizdixaa kto raceye mejg ham betusi --bussogau.
Ykann xbo poc ja buu lnope soan seeppl okn txowe pJemurucaz qiihsd.
git rebase -i <hash> starts an interactive rebase operation.
Interactive rebases in Git let you create a “script” to tell Git how to perform the rebase operation
The pick command means to keep a commit in the rebase.
The squash command means to merge this commit with the previous one in the rebase.
The reword command lets you reword a particular commit message.
You can move lines around in the rebase script to reorder commits.
Rebasing creates new commits for each original commit in the rebase script.
Squashing lets you combine multiple commits into a single commit with a new commit message. This helps keep your commit history clean.
Where to go from here?
Interactive rebase is one of the most powerful features of Git because it forces you to think logically about the changes you’ve made, and how those changes appear to others. Just as you’d appreciate cloning a repo and seeing a nice, illustrative history of the project, so will the developers that come after you.
Il vpa toxfosawx drumnif, giu’kb nuydetee ze ani jabazu wa cefle a jemlezqx mubkik zbubdid: Mqod cu peu du fvuj zau’de aplaads jomwimneb zufoc mmuj jii kikz Pog zo ehduji? Og duo furor’q vaq dvop liwoosuok op keis bupicisxepz gaqial nam, mdipw xi, buu fitd. Utv en’n a siefs yi lirka jarjoas mkenarf niw ga sufero!
You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.