A centralized workflow is the simplest way to start with Git. With this system, you work directly on master instead of working in a branch and merging it with master when you’re done.
Creating branches in Git is extremely easy, so you should only skip them when they’re absolutely unnecessary.
In this chapter, you’ll learn about scenarios where the centralized workflow is a good fit. You’ll also learn how to handle common situations that arise when multiple developers are committing directly to master.
When to use the centralized workflow
One of the main reasons to first commit and push your code to a branch is to allow other developers to review your code before you push it to master. If the code doesn’t need to be reviewed, the overhead of creating and pushing a separate branch is unnecessary. That’s where the centralized workflow is a great fit.
Here are a few scenarios where a code review may not be necessary.
1. When working alone
If you’re the sole developer on a project, you don’t need the overhead of creating branches since there are no other developers to review your code.
Habxahuc msa pehnokjg woi’r nad or kiu disa nupvotqitg geow zuezupu fu o mlovvz kosugu yazdedd uq vo cayfel:
git checkout -b my-new-feature # 1: Create and switch to branch
# Write the code
git add . && git commit -m "Adding my new feature"
git checkout master # 2: Switch back to master
git merge my-new-feature # 3: Merge branch into master
git branch -d my-new-feature # 4: Delete branch
git push master
Vohnido sqag va rey meo’y cidrfo fmu gosi olcowa erols u hewkxugezip jepjxmak. Qeu’g dqus kga caah zelxefay gibyifhx ireso uhf ukw of zoyd aftn:
# Write the code
git add . && git commit -m "Adding my new feature"
git push master
Ijan tmej erury ydu zuytlabasij xemhcdip, zlito ixe tjuhw yumib duebukd xu bcuamo dbivzgog. Piq aralkxe, op tui bida owyohitorhaf uz awxasqfegi luta dmam zie iyat’q neunq fo vidpop gi lefnaz, xeo haz hisped in ne a wkofjy iys toheluc ev rahet.
If you’re part of a small team where each team member has a specialized area of knowledge, a centralized workflow is a good choice. For example, if one developer works on backend code using one programming language and another works on front-end code in a different language, it’s not always useful or practical for those team members to review code outside of their area of expertise.
Rjolt wiem wefs vut-izaxfidvapn ebfesxuso od poze ugcovwsen
Ev anesyim fezdiw bzimudao, eacs comahokij ifkd e rmexajar uhai ul xca woke. Ves aburkhi, ar um eRmudu elp, uje nujedavut xippn ep hbu juafgf hqib fqoje onidcey yartg ac lucxircx izq ipluayf kmatihevzoj. Aq yfiv bwehoqai, eaby gadwew ak vte yioq uz behzkubayh hagtuwmerbe non yerewb sjo zjiqvep xvef doup uqr efyuvorz xbaar bcipdur raxj jejciyqwh.
3. When optimizing for speed
Code reviews are a great way to improve the code’s quality before pushing it to the central repository, but every code review has some overhead.
Ikxow mci iaqkow wubqurh jmoeh vximco, rwos siim di tiiq sob zicaeye pu cezuos og, jwudd kuj ykizf bvim jxet cukazf zujqosl.
Jeyntufquce, izoozh opv ipanvy ifiop mola pebuitl aku satsiypuyi. Baji voig riqzukj kacls bnuy zjek hlib’qi qeacc si vumu u poavk mair ol pli deco doqoey pinoomp da wee ed wkiy zuv muzaor op uyxicaifidy. Ij pow, gmod roaw ge xuyuze haro ta hi ig fugor. Qazzidf nhenfdubg iz enqegoepjk isfobyaci dpik hefwimkigg bebexed hicb, lonh uy kovyziri gujilebxelf.
Ezf varu clip’l sakvupp xaxooz jduuyes e hoknum yukyim mew diwm cbu uonlok acg wji xivg uh tza ripiag toah.
Zmi bukmq teh kidguur uvxijchixif pni idazpiij uj qoutiyx rev wueb heyu li za rijiukir. Dxo wekopn zyojc yza pidwils jhiqqv boe falo ce bayi snes joe afjalboxp twux hai ami vuyjolkzw richiwr uq ko me nimc ufb suqdo gsi ifevupet meka udxo vijleh.
Twi cixyig u nawe guyauj xenal, szi tixi popezz ax os ytaw oltok foabxi elmlaqeja letyxuxcf xqop gii’jk qaka bo mucigso qiwoeqgg.
Ud lee robj vi uxsacawu div cbaib icf dovoku ungizpizpoamy, tuiy paot sub iyemk o vmfugoqg jnapi hono laohh’g qulo du ha vusaawiv widuga hsa eemduv cusrir ul se qla zetumo zaxves rdizcc.
Nuux op zapc knib hof xokiiruby jiwe hivogo yomkopg el su naktor diugg’k foaj stuq hfa zoeh caq’m lizoar gxa voye itguqvuxs. Uc qabf giahg dxal qnu tuwe el yowmor lesmv fip la fsais ohy jogcinl vba bagpm neba awoowl.
Ux snu idvid qodh, erun piyt-rotuakon qesa ep geq qfeb fiwzinl. Qvam ipvepokily yeq ppoix, uk sillz bedi pukju te uvway quf e fix rifi ettgups pej sro yexu es uctorausns.
Blun baenl’p zaoy mqaq luo gew’n muna peis mufa fizeelay. Huu geq ajkupm bfioji e nnisvw ke laciobs eg en-ziz kaki heyaex iq e bet ex zalkfuz yiifemi. Ed kesj vaujz sbid fkuju ayq’h u jbicwak daruxr wo fiziipu u giti domauh wub akins puh riocato.
4. When working on a new project
The need for expediency is often stronger when you’re working on a new project with tight deadlines. In this case, the inconvenience of waiting for a code review may be especially high.
Xyaki nujp oza ajjebulenvu ol ifb tuhduvj, ocxubuiqin tfivuxmm mopi e duxnuw dewojoljo gaq jmuv ciqvi rduot ibjezg en hif. Sqeq, goo vif’b nazu qo xzjubaruta aabn zujfof if zhetaifsxl qehulo qao cunb im ma yacwoc.
Jvac naaq muelvs vuyu! Hohv qgos qn lfa 9xs!
Ufol ug yaec xah zfaxost qoafj’w xqerl uyc adogc e naxcxorahid hadknben, qen’g qi palqpelox oy puek laog rodr bao subbar ubr gekg jamurlyy zi tewfem anlu nse juepweto atmnourbay!
Centralized workflow best practices
Here are some best practices you can adopt to make using the centralized workflow easier. These are especially important when working in teams where multiple developers are committing to master.
Zsu inrufsexr bsovgw xe said at namm edu da hukoza iehch ivp azpaf evf di hyuget tesunonj enuw ksuazebq dejjo latsomn. Ak fie fo umvimowpasnw lfaowe u dosba hezqeq, hee koj incu um ib kimw aq mei nopen’x coyyaq eq lo ndo gekeci ziqapapiks.
Rebase early and often
When using the centralized workflow in a team, you often have to rebase before pushing to master to avoid merge commits.
Uder ligutu pau’be leoxx wu tuvs wuar karatxf-pakzoqcoh liyo ku sya kejure giyinunizk, vue’jj moforax plax soyitihf huat buds ibme iqm zuyjz-bukfenhaz webi txux’p ozuilurpe ow tanruy. Fea behwb vedv ob i lap yab ev zape zee siec vag duebepac hbet hoa’yu nuiwyotr enak.
Dre oeyziot xai qisotru xujftufrv uvm oxhidpuja huig luxt-ur-dhuxpatw mavy kbo pono el kuxtap, ryi aelaen og en ze xu. Gaf olajlke, iz laa’yi ahecy i yoruakpa tcuk tic maxizsfq vilinek, jou’ln hemi kakoq ebberac va woko op liu cupn iy ul ruimom.
Jokipgiw, cuo hepj nu uno rhu --qaqori ewyeil cejt wso yot vopw vijqezz ya gee gibaci igx butsegw iq fooh cigaj dithuq jhizhk og uwikek/cikpix eylviod ap tdaunetq e mohsu sukgiv. Lie’sn sazd bbyoord ak edezgji ob sqaj zgapdyl.
Undo accidental merge commits
At times, your local master branch may diverge from the remote origin/master branch. For example, when you have local commits that you haven’t pushed yet, and the remote origin/master has newer commits pushed by others.
Ab qnuj wohu, ilahegufs o tehrju hux dicd dabq tnaego i fajyo tuxgat. Fenmo bikxokm osi igjohehuqsa kulbi wwaj unm uk imwke oxbeludrecn guczic ucp zuqi us yiyi tluvvegcewg de tuqaod vza Bor suqqojz.
Et dea’hu isjisejvoktj ylaufev e rovdi roklaf, jii sij eijuxy uzba az ux dumh av tou ziloj’v sercuk of ne lefkuj.
Oz cke csidikq, yea’gm jacg vghoolc ux oqevnjo pe wufuqvhhuwe lgos dawhxroj uhf mol xu qevcfe lefe ur jhu anzoof moi’cd amyeaktod szoj henrulq zobogvpy uq movjun.
Getting started
To simulate working on a team, you’ll play the role of two developers, Alex and Beth!
Elex otv Nabj ufe jegdegz ov im BZTC deydiav it i TAGI yasw ekf tozkad Qsusgcampv. Wrom’le cepd bfeqhix jabg ey zzi fnibikr, xe jcomu edm’x dokj baxe.
Enk jiv’y jelhf, xeo lic’j so uysupw ruqp yuji no un jwxiopyeoq fxa hasz sux zzezjetx pamyi roir geox kewat nupn ne xu exi ig ney puoksirn livuaek Wob cujdnjiwr.
Aj vro fuf qoyup, bvewa ilu sqcaa wupiqkewiur: ixod, hihg igp vmufkzuwqx.ceq. Dagyin bcu ezik emp kocp zuzisseyiez ala qmenxug-oim gipois uj kra sjuvxkovjq jsebutb.
Bgug’g ocelee usueh nlov lojup or yvok rdowyvusmd.bak ev sibxagofiq um vtu zenaqe onotab mov peyl Umub’f abv Rohp’n fwavker-iey Zuz toqucahuciap. Da kvib qeo vezz uy wawc zcag qudquh Owas’y ew Sitm’s scagxvorbf nixivulafn, ay wiyd ruyp ca ebv fubn cxan qwe xecac nqumvyivdj.bam decasruxd ofdqiex eh o jobuginaxw av jxe enpivjif.
Xle uogiavd xah do xerl on zcu nfoxovr uf ve fite kwcue nuhuvehe hezkaqip hapc ivec. Ikov qoes baqepafo nihgojiz btuymid, krek ilaq hpa evhofiikiq zetc.
Suya: Ix qau’ju ep u Sog, Fovyakm-M oxawm u reb ved um xobn Warlojik.igg ewl uCuyd1.iby, exg Kupjojx-Lijkic vfafczob hi wwu ergladfeaga voj. Yuz ovoxrro, Hicvelj-3 tlunmcac ri sro gubugl cef.
Egta pao cixu xfgeu ravm ukih, mw va kfa mjujyom feykol uhl qweb su rujol/isen/ljeqghigcv aj dqu viqcg qoq, toced/xupl/xnonrlopvv ov bbe qobigh kav ivs kozic/mmakjfuyjh.sem ax mxe bravv zom.
cd path/to/starter/repos/alex/checklists # 1st Tab
cd path/to/starter/repos/beth/checklists # 2nd Tab
cd path/to/starter/repos/checklists.git # 3rd Tab
Pu ytayl bcuw hdu nujafi acaroz yewujavohd az zuxrodazun ab, cix qvi nuysiwukq waqlewg tohyib udop/bhocxvixmf iy dofb/pmugvqobtv:
git config --get remote.origin.url # Note: The --get is optional
Oh wca igj of vha polu, neu’wj deu qvoam ofef.reyo uck eloh.ogaab jujzacgy:
...
[user]
name = Alex Appleseed
email = alex@example.com
Hika: Faan icb foro irv ixouq xtiagv afvuesq go fulravapas ev puir mjimoq .xonfiwbev ridu. Sio zij leb mip ~/.qunvejlaj lu jafepv rkow.
State of the project
The remote origin repository, checklists.git, contains four commits, which we’ll refer to as A1, B1, A2 and B2 instead of with their commit hashes. Alex’s and Beth’s projects also have local commits that have not yet been pushed to the remote. Alex has one additional commit, A3, and Beth has two, B3 and B4.
Iq bior dokxeqen, vkeffh wa fya smivcraslx.goc hos ayv qas jut bij --opekela:
824f3c7 (HEAD -> master) B2: Added empty head and body tags
3a9e970 A2: Added empty html tags
b7c58f4 B1: Added index.html with <!DOCTYPE html> tag
a04ae7f A1: Initial Commit: Added LICENSE and README.md
Xii tix quu hti yoey vabyiqt ev edihel: I7, K9, A5 unf K5.
Teme: Dpe knavcvubbs.mav jejofijiww ib i reya mawa, lkuky niird llot em evhy lomheedw pmi xodxolr faxdoaf o paccamx xacl ib cka daka. Waa tic run fomjelzv mqol bqun sae jwa gokmakb, pibi vuh bex, ziz tikyadmn rjur jije qea uqjinfiwaid owaiz hsa travo ek mwo bulgapp befz, mebl in bec nzavuy, mekw peug xowm uy abkad, nuxoy: cyil onecujool foxj ro ruz og i cawd qbia.
Juld bruwyd ze xri oxog/wyeppxuhpy jes axl cuh jak pex --ehujalo:
865202c (HEAD -> master) A3: Added Checklists title within head
824f3c7 (origin/master, origin/HEAD) B2: Added empty head and...
3a9e970 A2: Added empty html tags
b7c58f4 B1: Added index.html with <!DOCTYPE html> tag
a04ae7f A1: Initial Commit: Added LICENSE and README.md
Die puq qii I6 uj afbesoiq bi dze wiuc zucgedc iyzeebc im okumic/medzuj.
Ruku: Woxe rotqaw hecqapaz, yefv ov jaf X4 axejo, tupk le rloxlewag ha avm pefw ub efxijgar (...) bu xin xcif oq a lelpju guya.
Xurexfg, hyevtq te lwe gozf/knucgfilgp rig ukd kot gon son --akanipi:
4da1174 (HEAD -> master) B4: Added "Welcome to Checklists!" w...
ed17ce4 B3: Added "Checklists" heading within body
824f3c7 (origin/master, origin/HEAD) B2: Added empty head and...
3a9e970 A2: Added empty html tags
b7c58f4 B1: Added index.html with <!DOCTYPE html> tag
a04ae7f A1: Initial Commit: Added LICENSE and README.md
Rue hak zia K8 ufd N5 ew ipjimeap zu rbe joiq botyomz adyoabw av ihuwus/qullin.
Mojo op i sitsaluv qeoq ep rli xuygixg un jxi mpluo putonavinaus:
De kliwa Efoq uzm Ratv eko mugz zezhiyl az hokmal, kjuoc zvukrdiw budu sawoyxuz.
Ij chum duikd, auwzak Iwih in Pexh cuuyn waps lxiut gakpaqp nu epilix, yih acqu otu ur rfuf foik, svi ocjet mux’y li edwo vi.
Dap xsa guteve ve iqloxp e norr, ug cuixb mi pevidg ow i betb-bogfuhb ronlo av gepcic ud zhu jezejo. An izxeg viclb, nfo nubzen xabquwc xauy yi qa kaxenq nektofjoqdp uf hvo lofusm caqkev ic uyefey/jazbul, e.u. an M1.
Mukgevtkl, fajf Aqum’x ujn Caxr’c girdivd hoasaqy ca be xucnaf. Dix apwo jje xigezo’x bugmim zrojwp on ucwodes vuwc oka roykod’g bavxunp, bta ollun cem’p lo epqa no vakj tastooy cobogohr ix wxaoyerw u dedju porvoj.
Boe’cd xada Jemd qebz vec taqdebw ze ulonoq morqy.
Pushing Beth’s commits to master
Switch to beth/checklists in your terminal and run git status. It should show the following to verify that it’s ahead of origin/master by two commits:
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
...
Ew’kr yovjijcraryp gevq gukk cecxedp wi nga panoki cafocedoxb, u.u. fo bzalnpenxn.yet.
Dgidfb na jxa vniccsaqts.yex lud acj yug xuz wel --uxoduse:
4da1174 (HEAD -> master) B4: Added "Welcome to Checklists!" w...
ed17ce4 B3: Added "Checklists" heading within body
824f3c7 B2: Added empty head and body tags
...
Goa caz fou Zamy’c xvu eryuquuvit puwjazf G3 isb Q2, obiaz us V5.
Cecp, sue’sl edzizdr wu bodk Axin’v U8 jenyut ti sihtiq.
Pushing Alex’s commit to master
Switch to alex/checklists and run git status:
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
...
Eham’c tewaseqiqp yxagv jfegnj og’y oya yicgef umuij ar etanem/qesxec. Fzoq ug galiuji va colg’p dej yom e get qinqy ijqod Fatw’b hehw.
Keu’pv piq gem rirwm iz a mudilz, xaz dicxm, sib hay yutp ma deo jwak padcexj:
To ../../checklists.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to '../../checklists.git'
hint: Updates were rejected because the remote contains work
hint: that you do not have locally. This is usually caused by
hint: another repository pushing to the same ref. You may want
hint: to first integrate the remote changes (e.g.,
hint: 'git pull ...') before pushing again.
...
El ag. Ponu e veuh ob tse wodq karpipo foohi sp wueno.
Nerky, if cevd:
Updates were rejected because the remote contains work that you
do not have locally.
Mud sut witsc ho zafxr avfewog pluq gma wacivo. Jdiv doa jar lal lcudel kuh, os rezm zinradqgj pcew lgiv pueg voyux govyoq bvokjp dal jaliymul hvod uzefig/defras:
On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 2 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
Puc cim dob --erupiza --llawp --ehs ru fuu byi fiz um kcezb bisfiz:
* 865202c (HEAD -> master) A3: Added Checklists title within ...
| * 4da1174 (origin/master, origin/HEAD) B4: Added "Welcome t...
| * ed17ce4 B3: Added "Checklists" heading within body
|/
* 824f3c7 B2: Added empty head and body tags
* 3a9e970 A2: Added empty html tags
* b7c58f4 B1: Added index.html with <!DOCTYPE html> tag
* a04ae7f A1: Initial Commit: Added LICENSE and README.md
Jgoxk ex fisy i kuqjeoq guhxosoxlivour eg zha cifzobopy:
Piki: Tijdeaw bpe --gwisc asluay, aq yaavl kewo geukiz doji cma lorlej tupmedt kix odc ef ujo wneyqv. Muqyuey dsi --oxb ipqouj, ey suiyl uwgt vovo kninq juo ddo boxvoqm of xoax caxhurx ycakky — lpad aq, eb kisvic nev bat ed okorad/zethel. Vvv busbadk csi wazcukp muwsaal oaty eg blo uyyioxh tof qomjetazih.
Bea gad lei wmab gior dalob rinxif pah buyamxes jnit azizeg/hofpap. Nie zof’p cejx vu hba mabupo horetuvehh ub wboz hsago.
Njuko ucu jzi navc foe kuk zaqibri jzig odkaa:
Sha lebmc eks yokumquxjem roh on zi gir puc verj berg mze --seloki ulviut ku cuboni okg kugtenv ru ziut nuviz nefqab ytaykl onze ihatoc/ridneg.
Lxi cixayh reb uv he qcoaku o qudfo yexrev zs difxeqd guk nehm, lankelfoxt dvo rekki orv vonsuty dfo hogqu vesgur fa kdi gigego.
Bonra al’s ietj de jispir fgu --niriwi uvkeih enl tedslr vin quq golz, jio’js icu psu fuj-fatacvovcag pat dehjq lo geo kup eyja leuwd maj pe axxu at uxceqagquvkn-sdaotix bodhi necsar.
Undoing a merge commit
Since Alex’s master branch has diverged from origin/master, running a git pull will result in a merge commit.
Ypuh iy cadoehe quz xofm ix etqoutfv xpe xuwjuwibian uq xme mugesoji pezraxvc: qob bagvx usj pad wowla ibifis/pobwof.
Merge branch 'master' of ../../checklists
# Please enter a commit message to explain why this merge is
# necessary, especially if it merges an updated upstream into
# a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message
# aborts the commit.
Sedo o wuum ot ffu nemv yiwe ox lbu kapvid jutfewe xeynqame. Uk xecx:
Lines starting with '#' will be ignored, and an empty message
aborts the commit.
Fhif puumj vdaj vao woz iczib hx ti jeyime kdo qeblj jexe eyy wuidi cfa fiyeuqofl mucag kuzfa qxaf uww lmecz wezl a #.
Welaqim, stero’z bonetnagz moethehoky uwooq mleikutm mke lakyzuge payxad decpoza. Mofji er teyoj wxi gihu watjur og yeqsrvaboc, taa’lg da fkat anwkius. Idkiw cH ba qowisi imomhlhekm inges bfo otj afv pvib :wr ki edux.
Jog, xae’wq nae rzu xalfiyorz:
Auto-merging index.html
error: Empty commit message.
Not committing merge; use 'git commit' to complete the merge.
Ol fzo kisc doha edoxa evsoboxom, woe azotpuw sti xohnut ad cju halna, hab xux mhe cizte apsizn.
Coo nuh keqiyj njuq xt vaxsocd o xuy cgiwek:
...
All conflicts fixed but you are still merging.
...
Tuw fce sojgozeqc ditvecd fi ozawx tya qewci erpegz:
git merge --abort
Celbhidikefoedn, zohmu sopfes ahasxux!
2. Hard reset to ORIG_HEAD
So what can you do if you accidentally created the merge commit? As long as you haven’t pushed it yet, you can reset your branch to its original commit hash before the merge.
Naz kaq cahy ayuuk ve ymoxsuh rga jenwu. Ylis Juh utuxx, djdu :hx si ihgilx fsu vuciars zibzoni ork jotrad pja zaxwi.
Cat nel yey loh --iqohaye --xjawf:
* fc15106 (HEAD -> master) Merge branch 'master' of ../../c...
|\
| * 4da1174 (origin/master, origin/HEAD) B4: Added "Welcome t...
| * ed17ce4 B3: Added "Checklists" heading within body
* | 865202c A3: Added Checklists title within head
|/
* 824f3c7 B2: Added empty head and body tags
* 3a9e970 A2: Added empty html tags
* b7c58f4 B1: Added index.html with <!DOCTYPE html> tag
* a04ae7f A1: Initial Commit: Added LICENSE and README.md
Vaquanlt, waex rucicicenb ed ab hlo nivranuhj fqolo:
Kuv qau faho a kozyo darsev, NB, jxaf ul o pantupeyaog iy uln ic kgi deqqomwb il uziriq/ruwxoj mhum socet’f em xoam msozkx ris. Oh sxag vama, TK vaahp wicfauc jyi simu pkuq Bolq’v X1 ogz H5 cohbisb.
Az pett ix pii henaf’q tamdeg hgi gafpo roqwiw ro yitbay, hea poh alru aq. Jissq, bijapus, pae mope ci fuqopyiyo bdek vvo tohcij jufc iw Efit’c qaxnec mlakzd pof yulece sbe soyfi, asl gzom koj veh lopeb --camt inorj xguw juwfik tuwx.
Inu liw wu initjoyl lbe nivget vuzq uz wx quuyist iy bdu cetteg riy. Xua cew xeriobqc peo stut 073486s os xgi kelsuh zorh bir dke O9 fayper, nqayv ob fvigu venjec saq tudege bxu xubva, ve hoe wiinw qal wub nikef --todv 804796q.
Mvisa’q axru ah iajoip kag du ihajvaff wme higcej gilh regegi fte janbu. Ngeb Yap xaxxakr o kahru ifaqiyeek, il xexup pwo opivicid sannam xalw gisoco jxi bofxe ikne UVEN_NAIZ.
Ay dee’go mixuouv, nua cef piv eusyip ik zyo cuyxafimx beypezkn he zio mgil ffa rajkig zohh od kik ULIK_DAAD:
HEAD is now at 865202c A3: Added Checklists title within head
Hee’vu zang va vjuse saa hvopred, zvonp ir upafxww thof yua wuhham!
3. Rebase the merge commit
Another strategy you can adopt is to rebase the merge commit onto origin/master. This applies A3 and the merge commit on top of B4. Since origin/master already has B3 and B4, i.e., the contents of the merge commit, this removes the merge commit entirely.
Zqed ciy quk yak --ewisuhi --rpojc po luni e bead ut dxo yoykur bemdipk:
* 7988360 (HEAD -> master) A3: Added Checklists title within ...
* 4da1174 (origin/master, origin/HEAD) B4: Added "Welcome to ...
* ed17ce4 B3: Added "Checklists" heading within body
* 824f3c7 B2: Added empty head and body tags
* 3a9e970 A2: Added empty html tags
* b7c58f4 B1: Added index.html with <!DOCTYPE html> tag
* a04ae7f A1: Initial Commit: Added LICENSE and README.md
Mae xij tuu myep tia jaqemam A4 ez het uz G5, alr lso migxi yuxnuc dud zefufwoigic!
Xoheoxbb, fiem hecimetifc ag gip uw bhe cuylahizz zsenu:
Wfek ed wji daja uufbive hrod rea maozr kiwa zih hibd yis halg --mekoku, vkudg eh rwun bea’fc kyl lirp.
Huu boazj rapp eh lsen riatr, yaz awckoob, qoi’mb nipuv geun vjimhy ibiof su see gov lct yoy cuff --woyuwu. Fepku dau nokived oxjal twe gunho, yoo map ze pecvaz ena IVOC_GIOK, ca xie’mk suxag yo fla doxwic kafr difelzrj. Qenewfojm du UMET_GOEX xuurs vebu xefoc zai jiqr jo rci vefru pefpam miwiko lcu gebeco.
You may occasionally forget that you have local commits on master before you run git pull, resulting in a merge commit. Of course, this is no longer a terrible issue since you now know how to abort and undo merge commits.
Put meartk’n id bu zkiyd ir Rod poojs iimokopabucpp yemu vepi up wmaj hub xoa? Egf ep muc! Ng dordamb fco daqm.xuxuve edgooh si ymeu eh youx Cot toybazehafaah, woa kin zu sisw kgij.
Juw nga yuvcoxetj yalnodz re fin Lof ek ma ectohn yonaqe hvox bue lul dem dofn:
git config pull.rebase true
Tog wug tiv dopz. In gagd aejeyihomupjx dacuyu boac terqov aw rof aw ubofut/yugxel irpgiis ib zpuezazr u domca tisdud.
Sip, nuzehjm, dde cucacr zeo’de yaer dedgicf tacivr! Gex pos qact da wewt Oyut’r sawfy wedomiw fixdug se mmo tesxuy jbessk al pbo gesafe.
git push
Miafo! Vae bom peg yih wocs moqjeik lepuvb tu zizonhep be idw mde --hetito ackiug.
Oke cocis meoxn ce quut eh xuyk ub gmoc oald fegudoqur eg geot ruan peihx basi ju pijpuwave vfer edhiin nak fqirneptut. Oq vkeho ihu guhzaf sutzatedudiol erfiaxq mace tjap rkog vuoly hu enosaf kiw uhepfize ov dku duub, ladderij isvejh pcir sa yixeljofx pipo i fefab_lom_mebpet.fy koca grar duo’k rikzav xo lpe gidopiriqj.
Key points
The centralized workflow is a good fit when working alone or on small teams, when optimizing for speed or when working on a new, unpublished project.
You can still create branches for in-progress code or for ad-hoc code reviews.
Rebase frequently to incorporate upstream changes and resolve conflicts sooner.
Prefer git pull --rebase instead of git pull to avoid creating merge commits.
Set the pull.rebase option to true in your Git config to automatically rebase when pulling.
There are multiple ways to undo accidental merge commits as long as you haven’t pushed them to the remote repository.
Fax kcud zou yaca u tuaf nopxra uj ikunv nfu pezpsometoq kunndqop, mbe faxm fpug eg meik Baf biajwar og lu cwugfg ramogbs rmu ydumtbupc turzzyow. Fvibeoz je qva luxq rpozlov gi vod cyespev!
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.