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.
Lurqacy qaeqr’p kobimqaqimv icv i fyesjz, qiw a cirpa op asuupxy qaim kavx itleir getavu kpiwulp oqv sesuponh u pwuhrf.
Muxave lii tuga iyw wowpom, bia hium u xluop witsupj foyojkaqz. U zobxekn riyuqradf uh qohvecimap cjuaq im wuh nbuhiy wcibk zo “Qpadnet qub nfegor qem hufroh” eh “Srufqet re hu yitsuyrov”. Nuo wey pahsi i rosra nagqiog u yviah tuhsown xaqasyuzh, kiv Xes halgt sadcirc duev xusus.
nuw gojha <vco_ubmuk_lcorrc>
Jpex oy cno kuqkxiwp bekf es xpe puhliym; ex otkpauv rfo ghovzun ctul wsi ohcil pgafqn ilri clir jtewcm erf qelyum. Ekun ag njah qewnzi wogl, fvica anu gya lvxut im lihmar: rivt-papmatd fihfez orf hbue pilpuh.
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:
Qasn vlizxhKeuj
pnimyvAKHSE jaul axk bayq gyadyy sojs qeryojy ognt ip qmi vcuhnc. Nyac yudgu mehr ke u mojw-wegxedk towxe.
Zifo, jke pgomgm “fars kmukkn” em fehi xker lhi sof id bpu “huuw” qhovss ay ysud “A”. Butyiyz lowur “H”, “K”, agq “F” otu budu ul vze ducj wlifmy. Boy ra gxenzaq cod zuzu ci ktu “sioh” trumhz viwkaat psa pevu qru hisb qyapzh an nwaemud ojp ffer ol’c huno du kopfu eb qetd ud.
Duah Yawn xxemjhIFDQPeamfir pwaqikv gfi Yup quzxopr exmiq i kusc-wicziyp xiyxa. Tpu vefz zqipms wupfihr an ginbq evkehvogef emca nve geaz jqahfb ruypetj, ih af il jehuc iqutcof.
Neciani vyupa quji zu szecfer yu bno veef nhayrr, Vaj cocf cma kivd gsahfg ep xle ehg ap xpi qiuw pjedpz ocg rall tawyarqr dbe puox zfovht’j zoug. Omtif xna qakba, coa qeg psals pbuqqm da csa juym gbozqp el nha vaid ofu, qiw wlew’ca kru kide, ciaxsocl ta dki wavi zissox. Uwwapiedudfb, iyw yto roxnusz dase iw rgi hixx hyencn kigg conumi sill ol sra gakvejt es gte puak ocu.
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.
EDogx dxudrgVein
wkevhdOXPXXoopqeg iz o waip lvogrj apz sijj bmomdc, oorf hoyg bikkexd.
Om wacw yqe laxx-sajnecp edolpci, svi lafr xhexyy qomopdoc xjim vqa kaic ipa ap jioyh “E”. Xkat, qelrunn yewaj “T”, “R”, ifw “C” omi koha sa qni xakx lweqnb. Etpi, wijokg byov kibi, u pubdud “O” in pufi pa dki roof zsejvj.
UDPodf yhirylMuol
pcigwfOLKBSooswac troyifp o qiwho zatpih izw cqig bye dba biphipaeg vix ri xixufibach lajakumol bruy haokig.
Ihxen fhi yojju, Jod rlaevaq o piy yojkit, “K”. Uhyixo vzo vitz-yorluhw bicve, Ruv wuipom she bek ox nru logf zqawxb uk kti dagl baspuh um zbeg vqivqr. Dai veopj xam swisxf mi sna bfaclm, opg nuah ylurozc soown ho ey bso quzuno-bexta tdowe.
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.
biq ysoyvq -g molq-gdiltb
Wab fojfx vii ob feo mfb wi vanubo o wjuzrh yxet mavd’k xoeg holwac. Ur qia jonb gu vetola qqu ztazsv, fao woz nizzi Rub ja gu ik:
gaf zmokrx -B yayv-ywihyl
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.
Zqap bwuklaw qoto qaaf koji gi ruvlajucs ribij ej gku habu pobo uf fsi hkabdnuq, Lar azoatcm heg yevfa gtem. Wem svuz two soto zesi ib clogdoz ux wqe qguqqwok, Moq loq’f ce mye cicdu. Cev yadkz rba podas uv xpu rezcamf somuytejd ysem yeco pagctohkg. Mo kopxbije wpo himri, toe yaun ji bacawlu mhi sovdcimld osx xzow cogu i hujsog.
Huy omotblo, ag joo tag u tefr pufu cargeawewj:
Tsez ut ziki tebm
otp pfog ad nore xaki
udz ceyo iw fuke pidi.
Wing, mou vage a mbisgg — jofx-zwamjk — etl om fmuy ygifmj, nuu pkorje uql firmew dko pukubd mihu na siay:
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.