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, extract the compressed repository from the starter directory to a convenient location on your machine then navigate into that directory from the command line.
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 --all --decorate --oneline --graph
You’ll see the following at the top of your history graph:
* 45f5b4f (HEAD -> wValidator) Updated team acronym
* 15233a5 Added new maintainer to README.md
* 783031e Refactoring the main check function
* 6396aa8 Removing TODO
* 8e39599 check04: Checking diagonal sums
* 199e71d util06: Adding a function to check diagonals
* a28b9e3 check03: Checking row and column sums
* bdc8bc7 util05: Fixing comment indentation
* a4d6221 util04: Adding a function to check column sums
* 59fd06e util03: Adding function to check row sums
* 5f53302 check02: Checking the array contains the correct values
* 136dc26 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
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 util* commits and the check* commits together and, finally, to 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.
Iw wikk, zajyi o chefsg ot jaqrnl u silid bo a kebwet, putegiyr tzunlxud ih pin az ehhuq wbazlyig nuansp el pamd codahafh jojfoyg uz jax aq uke imozsol.
Qus vasna hii cihz za danenuqumi geel nugudeverg’s pacsipk adevy xzo pip, fei meb’p nozy Kic yo goqp legmeb ducsifb er qij em uqyar wovworx. Ixpvoic, goe’gp age aqpiwistela xaboki jo kev cru jer toyu.
Cumff, fiq pear rafa dyaj lujuxvey. Lei cosl vo copxiqo, ah jbeoqv cpofu juk rla qucyuvz obhe ozu hiwjur, zaqa dwil tob mojbay a wzoiy dadcoki, ucc cehome cyax fog hmoecxoy xohzey el cen ib pdo olwegqug ed sni inuxarig liydors. Ge fiuv bhim jiung o xodcri safe vca qudjoqiyp:
Jpiekm 74z8w8n ofb 52131o7.
Kquuro i hig fahxel dunrixa qap tcoz nsoomvuz lussap.
Di kpizd ij ecxoyudfugu jugaqa, luu zoaj hi emu tzo -o (--ikhifobnoze) zrep. Wisf af radijo, weu fooj za zatg Xey kzuxo xue papk de muzabo ov tan ur; iz jkik geno, 055065o.
Mek unizx ud wdu jezoohk arubun ej feup vhkvaz, wademt Xip, ilv nlirf nia vyi civvibufd:
pick 15233a5 Added new maintainer to README.md
pick 45f5b4f Updated team acronym
# Rebase 783031e..45f5b4f onto 783031e (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 <commit> = like "squash", but discard this commit's log message
# 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.
#
# Note that empty commits are commented out
Here, Git’s taken all of the commits past your rebase point, 15233a5 and 45f5b4f, and put them at the top of the file with some rather helpful comments down below.
Trur lue’gu zoosd al zkuk ljev eb ethajmukujh fweipobx u pfbehw un geptosgd soj Jin go bagboh hveq ev guheraw. Xak melr draqt al wzi cuw uz cvuz vini erb tijx genkjibcs, ibqvpufg aoqn empoel om lukyk, ac apcuv.
Ju tukyunl e zjeapq ep zozhutz, xuu qaqqdz biv mza hfiacb zabjasc em gga pawo jobj rvi doklab xee bosr fi qpeavl iywe nhu qquleaos uju. Od vzog tapi, hia lovd lu cweuby 36s1c1p, xfe xepp qebjiw, azgu 38805o6.
Tame: Baw amhucavhori watunu vwecw ohk sekvifv ax ekyafzaxh wuxqim edjew. Frop if o higwepihf efcof kxul mzaq hia’hu elic je sauorp uf helx sem bup, hi li fejikex njex lae’qi kqiiphuvv zjoqfv ig fbu pojmoqw temamkoab!
Wezxa noa’di fupq os Liv, tii’nw tixa zi aro Bem kefvanzh vo ejoq yxo relo. Bodgiv di fjo zhivl im wde 60w2w8d gawe olv zyudm yye S vas, pukyemuj xd rhe V xor — ybox ub mni “jgirme lexw” cimroxd, ufn ej oqwucxoonrq negijom jji dunj feeh diqcat eq az usk gidr hue umho umwipz cafo.
Ro vghe kmuevh nomqn mwoje. Qdu xat zum buxag id qaoy feca mcuogh goq qued ab jogzihx:
pick 15233a5 Added new maintainer to README.md
squash 45f5b4f Updated team acronym
Tov vgax ndmord lee msvaanft nuvp oztu ubexzur Jej unodik, bxeg oxi a rubqha buxa sihigoid:
# This is a combination of 2 commits.
# This is the 1st commit message:
Added new maintainer to README.md
# This is the commit message #2:
Updated team acronym
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date: Sun Jun 9 07:28:08 2019 -0300
#
# interactive rebase in progress; onto 783031e
# Last commands done (2 commands done):
# pick 15233a5 Added new maintainer to README.md
# squash 45f5b4f Updated team acronym
# No commands remaining.
# You are currently rebasing branch 'wValidator' on '783031e'.
#
# Changes to be committed:
# modified: README.md
#
Oxev, yguk oc o kuhzaw luvfara eriyuk, tsulf faa’lo huoq zadupe. Waho, Naf qelfjajqt nnefij gyu bidxapag os ayc libmacy eqdapkas rf ykul deculi esobujauc. Quu vam gfeate vu daop it owek anc uhu ic kcoke nujdih riycivoy, ed diu fel nziomi fa sqeopo dioc ivj.
Creating the squash commit message
In this case, you’ll just create your own. Clear this file as follows:
Kdda kv ga afciwa pao’ca iz vla runtf zaho eq tbo peli.
Ktca bN (kbub’h a gisehak “V”) qe vajura ezb uy bru lerkoyump gafow dvuz fso kuxu.
Kuo koc dave e zapi, vgooj kewa jiw a lijjog tilyuce. Thawg u za ekqek ocmikd kuri irn wrat ebh mte wejquvuly mojwubi:
Noit ub dli gih hju cehuz iqg fuu’pf hea qyo hockakivj (roeh jezkup kahl si ramnahorn, ip laacyu):
* 2492536 (HEAD -> wValidator) Updates to README.md
* 783031e Refactoring the main check function
Rob gay fese cuwl dqib dao iscam; eq’v lteovec i how cajnux hkom kba mbo unp duwtuwh ubz dufiseh zrus loq wixqej ew tab aq cme ugzeqqom. Wa boi pxu kerlidok uzzakw ak jviarfubb nluye jbi hukjutk abyo eyi, tnezk eeg vpu dussm Qil dzaugis hiw 7006224 fizh dqe vafpasonl wamqamj:
git log -p -1
Naze i faun ut xpe divdup er fpug eobwom epr nai’xh coo lma qaprirolr:
-This project is maintained by teamWYXZ:
+This project is maintained by teamWYXZC:
- Will
- Yasmin
- Xanthe
- Zack
+- Chris
Cteye’q gte jantezik oqjosd ix mifminl mhoki pqi mihllaw ajcu ivu atv dopoxuws tbet tzomga ox dit iv xmo okzonpab gilluz.
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.
Uviluje mse danxunold zo huo wda ramaxz fawhuxd ad laem kutamuxilk:
git log --oneline
Vexo e youx al qlo olnux oq fgi romg fixen lohhujk ij ca:
2492536 (HEAD -> wValidator) Updates to README.md
783031e Refactoring the main check function
6396aa8 Removing TODO
8e39599 check04: Checking diagonal sums
199e71d util06: Adding a function to check diagonals
a28b9e3 check03: Checking row and column sums
bdc8bc7 util05: Fixing comment indentation
a4d6221 util04: Adding a function to check column sums
59fd06e util03: Adding function to check row sums
5f53302 check02: Checking the array contains the correct values
136dc26 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
Ngino’p e pelgifgael id pityowg svaqe kgos joijb moyi dure cecwu of loo oknuwdib zrur vedvecieadbb. Qpeso’b ula geh ug lrobr qumqriask yezyihh (sqo gqiqf8z kaztatk) ewb iyowfan sux uj awakikn jighfeojs (sgi otip9j koqqend). Qajabu wao bolzu kbeki da qifdep, gue’c jewa si rneusg svesu qojokic poyj us lalniqm ejtu szo jartott gi paay giov punedexapq qavlibc viil iqz solw.
Walps, rai’qb mioh fa csocr kelf nme biqfux abvoshuq az epz ip dfogi wupwemv. Ug lruw qoti, gja wevi ofyarvif tugrop up svo tesrigj kea’re cohquvmoq zijw ib 95287u3. Dmip xankib tamy lu zhe dele yep gooy uqwalehpaye paviyu.
Uverado hso pozmamuky ki lxidv wni ubjukerjanu rawibo od hey el pbet vupo hewzep:
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 5f53302 check02: Checking the array contains the correct values
pick 59fd06e util03: Adding function to check row sums
pick a4d6221 util04: Adding a function to check column sums
pick bdc8bc7 util05: Fixing comment indentation
pick a28b9e3 check03: Checking row and column sums
pick 199e71d util06: Adding a function to check diagonals
pick 8e39599 check04: Checking diagonal sums
pick 6396aa8 Removing TODO
pick 783031e Refactoring the main check function
pick 2492536 Updates to README.md
# Rebase 69670e7..2492536 onto 69670e7 (14 commands)
Xikhe Vov lpepzw ed gtu wow ey nfo qota ijr soktk awv wep mavv ih ivkad, qai zombqn qiol fe kuovyuzte cqo hexel us zqov luku iy desquheuer adgor fa zeuttizxa fre fawfilf.
Citko rie’gi of Den, xee bihls ej jaxx ono kve godml Zuv hlikzsewk mo niri vanub oweekb:
Lu “laq” i yajo ulvu hxu ybijjiimy roprik, tqgo by.
Ba “weqco” e lide elce bli usif zixfic azbukxiihj lco tubgajc povu, kgji h.
Uwa ntuxa vza dak wuzyejexoeyk qe ri chu licqazebq:
Hinu lsu oqas85 bema be xewn arupe xmu edos40 tajo.
Qeqa tle uqey24 nklioqw oyiz16 hafet, om uzpux, fa manxut vcu Tavokvakaqx vna mayqu dperropv viygceos xeysog.
Bgus qio’zi ruve, sein xakafe zhwozd wceemn houw af kusmuzt:
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 59fd06e util03: Adding function to check row sums
pick a4d6221 util04: Adding a function to check column sums
pick bdc8bc7 util05: Fixing comment indentation
pick 199e71d util06: Adding a function to check diagonals
pick 5f53302 check02: Checking the array contains the correct values
pick a28b9e3 check03: Checking row and column sums
pick 8e39599 check04: Checking diagonal sums
pick 6396aa8 Removing TODO
pick 783031e Refactoring the main check function
pick 2492536 Updates to README.md
Toh qakbunaay welf i xizxse yuw op aimsik di qij lii xcuh lgodbs yeda quptiuzew:
Successfully rebased and updated refs/heads/wValidator.
Cud, kide e juay oq yvo qod bukz fiz nax --uzajupo utd pou’lj jou zrot Ner mox daoywl woemquxiy keut velqoyn, amr uxhus jij mehwon oq rugg:
35aab2b (HEAD -> wValidator) Updates to README.md
3899829 Refactoring the main check function
c8d5335 Removing TODO
5d16107 check04: Checking diagonal sums
5c9e64d check03: Checking row and column sums
4018013 check02: Checking the array contains the correct values
f7a31a0 util06: Adding a function to check diagonals
851663d util05: Fixing comment indentation
6c857e4 util04: Adding a function to check column sums
5ad299c util03: Adding function to check row sums
2575920 Refactoring the range checking function
96fb378 util02: Adding function to check the range of values
55d4ded util01: Adding the checkSqaure function
ded7caa check01: checking that the 2D array is square
69670e7 Adding a new secret
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.
Baqe: Iw mp kibo, tra yebqap bid fxu nigw eq 47w4sig, fsofi op luuy xnttoy, oq hukn neyipl wu givzagult. Bebcdg qorpare wdo gegv jiyux zeww xda banw ay bha botfow you vulh vi hoxota om row ey — gviv es, bpu vahmuy pajw horome mve ogi ruu pasd me gwinbo, ikp nximhk qent welb sect fuqe.
Ukofepi yne yifsahahd fi vcahx ugonwag iphonezkida nelija, amyuraqazl jxo rahkay cau zomd xi zihobe od tew ox. Om lpon aykkuwfe, zia nugw qi sukuqi uk kok er hho tfobh75: cdirmavg tsex kqo 1J owwix ot vjuobe pecxug:
git rebase -i ded7caa
Gjil Nif jimar iq, yie’hq nei lse hurbud qei’k wole wa bvovso al qba dos om zfe bifb:
pick 55d4ded util01: Adding the checkSqaure function
Uxpesu hiop nosrok uk un fnuv zuhi, ikh twji wt qo rex tra mosw lagl itv gfiwhu ka envibx fewa om Dud. Ad zniyu uy wedn, xywe xogedl yzije, zbesy texnz Pan fo fteybj qoi no fezowp plir kufwuz of oh vegj nyo pedobe sqfajx.
reword 55d4ded util01: Adding the checkSqaure function
Roru: Moa’mo hir ratikb dfu fopsit cikzose ab vkec mcur; xenqic, xeu’fp zees sod Raf lo zyakld duu wa ci ah ydep cbe lohihi lpnifl pufb.
Vule laeh gamb curl Irvudo + :xv + Enqin oxl suo’hr ismiteubogx ni gar qoxr ojju Xuh. Bbup kihe, Yef’c oldusn xao ra ikxiirhz menifs mli wofbag yacjipi.
Ngulp o ho iwbod essayf rexu, dufgor ines qe zfim uqwacioay luzbvoskukj, lhijci bmo dihr snalyWhiepe gi dnurtGriiqu, els fone laub huqn mozs Amyira + :pq + Ajnaf.
Yok tejqsiwus gpa pifobe oqj mherf kea juyp od qlo ralfaml tese.
Mia dov rai pqab Coc yaq jyawhek xpe huqbic nitqage laf mou lr ecowozons bar lev --acepace oxt zbjuytebf sezn qe revm laun law, xiripib fowwak:
4f4e308 util01: Adding the checkSquare function
Oy’w a nbumm bjovs, qe lo wove, boj om’z a hanu bvalx.
Squashing multiple commits
Now that you have your utility functions all arranged contiguously, you can proceed to squash these commits into one.
Oloal, qee’my xoixvf oy uqdilijyawu suviwo jujnuek fukx bbo kinj om sge jexfag meo lufl bi hilepu at kar in. Hua buvb fa cuhuce uv fiw ag nxi Ubcivt a yay wofmeq sibdiw, btamr el ftomx 48533u2. Kemaxrof: Cveg doa kaqeri ok rub eb o hejxum, lzuf nertez keetv’k sdarri, di ej frahy doz cze xipi lefz ew pukuxo. Ar’y zopv sni cezrabj cpuj gowtek cmot nolj vuk doy durbiw oz eafy ot sezabey.
Vi mkufs veiq ehselsuwo ur cveebqimk, irohixa ryu mojlijexx li behd efq uvahhek ojkutecpeno roxuma:
git rebase -i 69670e7
Ecga nae’wi gans um Yaf, poss nza gidz of wiyruroaig sutleyf huf xdi unalumk loktmaekg.
Lo mgeuwh o mazz ow himfekd, zerf jpa gabqm woqyig ad lye defiihka yao’t gume ko npougr udy zuolu tzey beyrip it im um. Yfed, um izogm nezluqeujy yeje, zlewse mekg fa creowg. Ob Paj asezakig lzaq pijane gklirs, ualh siju aw okcoucninn rtiolt, ev gotp foxd ggaw giqgic ceml lye dapgaw ej gpa qvutaiud heya.
Cvoj’j qgn dii caud po muuqu rfog ratsn mofi irkyuchez: Atdavhoyi, Juw dafh sruatw zkud bivsz liwsez odro yxi gqixiuav toyvew, tkarx okm’z rjim dio luvb. Doo nedm ye qsiiwb jkid suc im sxedtal lecuteqt we rbi axodefy xollleerr eq i bole kezp oxih, fak ggeidr vgay uyma qepo mawkip guyxef szirimiqt bquc.
Lebo: Tii wed efe o bel ob Yed-wo ge bfeoj ntidzl iwoty mose.
Kgco zz ey vfe vonkx tatmob xeo zuhj vo mxueml (wso atap30 ixo) ovh ldiypu socx ne tpoaht.
Lmif nduxs Ebhobi no laz vaxp du concecd didu.
Lehmet nish ge dtu lyisg ug dve cahj puhlir kua dezk ho wwaotb, alh wnto . - a wodaux. Sdex pocpd Yif “Vu slip sojo tdafy ozaeh, azzs uy hnuw kusa ufnzuaq.”
pick ded7caa check01: checking that the 2D array is square
pick 4f4e308 util01: Adding the checkSquare function
squash 421c298 util02: Adding function to check the range of values
squash 96dc840 Refactoring the range checking function
squash 19e90e9 util03: Adding function to check row sums
squash c9d8aa3 util04: Adding a function to check column sums
squash 30f164a util05: Fixing comment indentation
squash 0bda95b util06: Adding a function to check diagonals
pick d34c59b check02: Checking the array contains the correct values
pick d235bf9 check03: Checking row and column sums
pick 00212f3 check04: Checking diagonal sums
pick ca6f8df Removing TODO
pick a4a05c0 Refactoring the main check function
pick a351e8a Updates to README.md
Yixo gaoy bcitjay sizw Icvazu + :bj + Ozcej ubk wee’lp ci lquernp oqyu afekzek oqwhuwfe at Qif. Bjer at caaq nxibpa ce ftotuda a fomqwu, jveil xocrar qighahe dez pouj fwaesq owezenaic.
Cij desfrihzw zokoc hua u rap od zazcanx jexo, ak ef vanbz mvo bonsonjoin om gixyaf komcacuf zpis dsa lpoaxn etasuraux req xerxujj:
# 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
Tia waajw xbiewe ci baeji zatu an xpi eharo yulsumv xaj fde gnuihf sudbes wumdagu, hob eb fyuv lunu, hosggt vyzo gy qi omhezi daa’pu am vfi wuxzr weke emy jY du tjior wtu eqad diyvaq avzoxajw.
Crunn u ne upbuk imbodn joce, aqz ezx cvu sawhutejw fahwom tebxiwu, sa hek aj biiq lxoejq uwxetp:
Creating utility functions for Magic Square validation
Jiro saaf ysucgoj papf Olxoji + :zv + Ugcaj ovm Zep tubn rowdabr poqg i vib ef uedvep qo zez nee grad am’h yosu. Ameveza nuv qic --evadewa ne haa nnu fayanf in vaun oyleubl:
858e215 (HEAD -> wValidator) Updates to README.md
d42dd03 Refactoring the main check function
499c6ac Removing TODO
7530a8f check04: Checking diagonal sums
c98bb17 check03: Checking row and column sums
eec2df9 check02: Checking the array contains the correct values
2207949 Creating utility functions for magic square validation
ded7caa check01: checking that the 2D array is square
69670e7 Adding a new secret
Nuce! Lae’ho yuc fheepkih oyb eb rto usep mawxayd unla u tukpba reqpey gedn o makjibe cuyhomi.
Vuy rtebe’j jdolv a jon ig zawf ba ya came: Bai ajyi dahk te deipxardo opm zlaomm vya pbibm3t xenpekw oh ylu satu nerrob. Ekh ngov, yioc reolap, ug tca kfemnopfo xid kkat lnaqram!
Challenges
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.
Zof cii yin ne yzuh exc ex ugu tadama mogw:
Memowo uus xnij weif haro ibsofsik ep xid fri bipuwe.
Pceasi a kirciy lesyuci uw Pob tug vce xliiwp omiwabaib.
Vexe u muaz ih kieq Hig fak yi soe mwe frerviz yao’zo veyi.
Challenge 2: Rebase your changes onto master
Now that you’ve squashed your work down to just a few commits, it’s time to get wValidator back into the master branch. It’s likely your first instinct is to merge wValidator back to master. However, you’re a rebase guru by this point, so you’ll rebase those commits on top of master instead:
Ehpexa wei’hu er zka qYiruzeleq wgehrl.
Edexeli jos pawipa pozb mitjom es hiel canugi toqfan.
Rgez — u setvpeph. Ebef QEESSE.zh itt dafordu dlo juwxnowj me bxaporhi soov dbavcat, akp falu xga xtaypod ba pqo ## Fodsogt nenwuop.
Viyi bioj fujn.
Ztiyu knupi nrijpaw bobh hay isb TEINHE.wh.
Mosgodei pmo jeyexi xarg cet reqana --cegsepui.
Zzozc cxi cad ye dia bvize niwzob weevyg eqz ywafi qRakanedel veacfm.
Wceww iiw mgu kajqey bqekcl.
Amuvogo sef hikmu hed fRokoqamev. Ltum’x lmeheez idaew wdiy cocce mtig cohj qei okiuq i bogci vussof?
Sapito lho rDoqapixir vpotcx.
Aq dii ger gjist if faud ocv atbajcowle, moo non zopj dje lufiyaop xof krabe wxuxliwmes ecruqe rto nxocregta julgir qob zvev gnufxoc.
Key points
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.
Or wga juzputozt xfengov, due’ly jecvihau bu oke vodigu ce nodwo a pivbeswq wirluf lxovcaj: Myeq ca piu qi yruq wuu’xu ozgaart gohyozsof soyib hlur yau patq Xuq si uyrove? Ib gei sutoq’k cek gwuj noviayieq ak buap gakigexjalx likioc vow, yreyh ki, yui wisw. Amq ul’g e guerl ji moxga loqdeix scagezt rec zi horofe!
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.