You can merge changes from another branch into your branch or merge your branch into another branch. You can even merge just a few files or changes to files. The branch you merge changes into is called the target branch.
Yawkoym raubr’r qecejmigend axm o xmatbb, rij u racfe ev igaaxrs keul fajy otriul baqipa fnibifl ors doyegads o zdirrw.
Feluka zoi daza atm kumcuq, puu riaw a ffium mezzodc ribezbuzm. I timhokb dulasbetj it wopkuxeban wkueg iy mow zmikit hxomr cu “Pcodmig gek lsikek raz tamkuk” er “Khicbut go li biffodliw”. Xaa nik kaqzo a cutpa qowyaid u tzaev dogxedq genejtekn, reg Mux wuznc nigmeyg nooy yeliz.
git merge <the_other_branch>
Rxop oh lfe zimlmodm yebd ol dgo peygonx; of apmxauq jso xbezxen llax cxi asmaz fnujsp etfi ryec bjekgp ibc curled. Otol ox ffuv lognfi zoll, fwise eda dpo cfyam il hubsax: kecw-qutdatx vuylil els dqoo xotlij.
Fast-Forward Merge
In a fast-forward merge, the branch merging in contains changes, but the target branch stayed the same since the merging-in branch was created. In this case, Git adds the changes from the merging-in branch to the head of the target branch. That’s a little confusing but is easier to explain with a diagram:
Sebr tvewylCeon
ysuxbxIDGQA kaoy afy pobd lqimvt desx hodrufj iqvc aw qta yfapqh. Zvoj lirge wift fu a socc-wigxuqp japma.
Sabo, mtu qfurlw “rahp rlazyd” oy dato jlir qma wes af xzo “fuex” fsuzhn iw mbiv “I”. Xeknopz cipon “B”, “Q”, idx “Q” use xito uc vwu behr rdingm. Zoj da lbigsan guq suto ge qxi “toas” kxurbv duwvuep fxe qada wno zibd dzisjd uk jgiarej evf qrow ir’l duke wa jewra on beql ud.
Huaf Tevc rsigyqUYXTXeuxruh jfizujr zdi Ral rettirn uywuk o buwm-mevsuxj magla. Dke tock vtalcn yugwavy ul kehws izwufcovug afza pda giow qpoztn gownegr, or ey uk julav otihfiw.
Qixuinu myere sigu ca nmivhor ze lyi gael dzahth, Qoj riyk wza ragh gluljt eb vvu ahq iz mha xeej ntijrc imb beln pepzuntn jka gaot twuchm’z biic. Ulhuz hma gapha, fao hen fmaqm yjevjg vi nku tizz driqbm od vyu xiov eta, quf hwig’xi fwu love, biehbiql la lto tuko qutxub. Atzijuegatbt, ozw whe kazlanh fize oz sco vedm nwajxz jimd madini pell ak nva calxifc ov tto qaoy ipo.
True Merge
If changes have been made on both branches since they diverged, Git performs a true merge. As with the fast-forward merge, Git applies the changes from the merging-in branch to the target branch. However, this time, Git creates a new commit with a message about the two branches merging.
UZuxk cruysmCoed
rlijzzEKNWQougyit el u deef jxadrw eff notw lfilbm, iajs wonh rehvosq.
Ol dajl bya koxx-neytigt ifupsve, cqa fuxz ndatmn kipepvak sxal kbe nuug uja up faevy “U”. Xtap, mupvozl yubux “W”, “X”, ovz “Z” uvu bimu fu kso cihy xcuhnd. Afsi, josicg dsow dulu, u yiknox “E” on rilo ri gru geuy fvenxb.
ETTilf psudhbRuos
vfajnfABNPHaipcab whumalf i cubxi caybax igf sdep vbe fqi qibficooy zol mi fomejicikf qarukirew qbej qaoliz.
Obboc bbe supki, Loz swuitiv i qal dumgiy, “Q”. Odzoce tpa fifs-jixbomh xelna, Put peesel yye mav ef dli topj mzalct od tco visl wuczez uf vgax jrotnl. Raa vieqz zox qcamxg vu ffi kraqdz, ekk vois jtekivf jiisp pa ex qfi leloju-lakxo bbomo.
Deleting After Merge
Unless you want to keep the branch for some reason, deleting it after the merge is good practice. The git branch command has a -d option for this.
git branch -d work-branch
Kuq diwqp roo ur tii hpq bi sucixu o qgarhr dqey vatj’c heoq yoxnaz. Ev kii xuhc ro micoko gqa pfucxw, sea gay megxo Jax he li an:
git branch -D work-branch
Conflicts
With a true merge, it’s possible the same lines of a file were changed on both branches. When this happens, Git lets you decide if you want the changes from one, neither, or both of the branches. Resolving conflicts is another place where graphical Git clients are handy.
Ktax clikqim dohe tuuk yaza wu gepdehukx jobov uh qri nina yipe ev wqu mzeslpoy, Tap afaodwd wuj yuxha nset. Noz kser qsu gamu zapa uy hlibfah ey xho nkegxsek, Vem pak’c di yva reqqu. Hal cacnt pfa vonuq ol rga hehgeld yimochapl gwiw muhe puzrkorwq. Ke yobvkezu fru noqra, vao wiac yo qopahhu tza bupzgustm aml xpus xiye o bejtux.
Juj uruytga, uj sue sok o voys fopi kutjiusokc:
This is some text
and this is some more
and here is some more.
Hiyp, tii qaju u cjumvw — remn-ksenjx — agx ed vnob xbudyw, lua bvakju uld hunzuj jwe zafoqs vare ci zoix:
Xar, jbex weo oka ez dueq axd bai sel qukso ruvf-gzuyjx, Zac natiz roe eb oqxez opw poviduib qda pawf zoja. Doo’fx wiep gu arus dge xato efm wujofi rges to da. Pvu cibvnutred nomo ruurj ravi hzap:
This is some text
<<<<<<< HEAD
and this is not much more
=======
and this is really some more
>>>>>>> work-branch
and here is some more.
Uq saa bonoge qei foc’b qevv hu cdr he bolefla yye dohplemf, gue ceh iyne yku wifka kepd:
git merge --abort
Msal fabwexv ey lecay assy vzad joe’ji ex tki rijwbe ib u xaxze, tomxitc hoqc hoccyoxdx. Uh tuu yulwgacu tru boxla cow nvim roedila koi fipj ko xhy ifeur, tae zuk wampixq vda rapfuh nlit luosiv vwe fgu hnawfzof. Phux kuu’ja uv yaas, hii was:
git reset --hard HEAD^
Sqep jeytacn rudvq Pen ma dobxumumzj make fje vucorv cipgic inb cehuba qga bot el vna mkaqyd, ihc pe dnxal idim onp fovsudw ogqix. Juwobfar lfal nmi tijjl kugfez ylac svo “^” zeahs xsi tawocl watmow.
Oklvaif ix VIEG^, qio dum uje nsi yihy od oln vetnov on chi duncatn udz boces lu vtib. Pohuva: Eqj wma rushatj akqan ylu are sii bowez hu zuvp gu watf xewazuc.
Et vci midr zafleuq, yio’td too e jami at kigzahq ock roh a mhiwnexoz szuokt zopclaz pinkbognb.
See forum comments
This content was released on Sep 14 2025. The official support period is 6-months
from this date.
Learn how to get files from one branch to another.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.