Sida loo Hagaajiyo Cilada Midaynta Git

Fikradda laamaha waxay la xiriirtaa shaqeynta Git . Waxa jirta laan sayid ah oo ay ku xigto dhawr laamood oo ka soo baxay. Haddii aad ka beddesho laan oo aad u beddesho laan kale ama haddii ay jiraan khilaafyo la xidhiidha faylalka laanta, waxaad wajihi doontaa fariinta qaladka, Ciladda Git: waxaad u baahan tahay inaad marka hore xalliso tusahaaga hadda(Git error: you need to resolve your current index first) . Haddii aan khaladka la xalin, ma awoodid inaad beddesho laamaha Git . Looma baahna in la argagaxo maadaama aan hagaajineyno Git Merge Error maanta.

Sida loo Hagaajiyo Cilada Midaynta Git

Git iyo astaamihiisa(Git and its Features)

Git waa koodka ama software kaas oo kuu ogolaanaya inaad la socoto isbeddelada koox kasta oo faylal ah. Caadi ahaan waxa loo istcimaalaa in la isku xidho shaqada ka dhex jirta barmaamijyada. Astaamaha xusid mudan ee Git waxaa ka mid ah:

  • Xawaaraha(Speed)
  • Badbaadada Xogta(Data Security) iyo Daacadnimada
  • Kaalmada(Assistance) hababka qaybsan iyo kuwa aan toos ahayn

Erayada fudud, Git waa nidaam maamul oo xor ah oo furan(free and open-source) . Iyada oo la kaashanayo wax ku biiriyeyaal kala duwan, waxay la socotaa mashaariicda iyo faylalka sida ay wax u beddeleen in muddo ah. Intaa waxaa dheer, Git wuxuu kuu ogolaanayaa inaad dib ugu rogto xaalad hore(roll back to an earlier state) ama nooc, haddii ay dhacdo khaladaad sida qaladka isku darka Git .

Waxaad u soo dejisan kartaa Git ee loogu talagalay Windows , macOS , ama nidaamyada kumbuyuutarrada Linux .

Sida loo Hagaajiyo Khaladka Isku-dhafka Git: Waxaad u baahan tahay inaad marka hore xalliso tusmadaada hadda(How to Fix Git Merge Error: You need to resolve your current index first)

Cilada Tusmada Git Current(Git Current Index) waxay kaa mamnuucaysaa inaad u guurto laan kale sababtoo ah isku dhacyada is biirsaday. Mararka qaarkood isku dhaca faylal gaar ah ayaa sababi kara in qaladkan uu soo baxo, laakiin inta badan waxay soo baxdaa marka uu fashil ku yimaado isku darka(failure in the merge) . Waxa kale oo ay dhici kartaa markaad isticmaasho inaad jiidato amarada(pull ) hubinta .(checkout )

qalad: waxaad u baahan tahay inaad marka hore xalliso tusahaaga hadda

Waxaa jira laba sababood oo la yaqaan oo ah Cilad Tilmaanta Git ee Hadda(Git Current Index) :

  • Isku-duwidda Fashilka -(Merge Failure – ) Waxay sababtaa isku-dhafka isku-dhafka ah ee u baahan in la xalliyo si habsami leh loogu gudbo laanta soo socota.
  • Isku Dhaca Faylasha -(Conflict in Files – ) Marka ay jiraan qaar ka mid ah faylasha iska soo horjeeda ee laanta gaarka ah ee aad isticmaalayso, ka dib waxay kaa mamnuucaysaa inaad hubiso ama riixdo koodka.

Noocyada isku dhafka Git(Types of Git Merge Conflicts)

Waxa laga yaabaa inaad la kulanto Cilad ku biirista Git(Git Merge Error) xaaladahan soo socda:

  • Bilaabidda Geedi-socodka Isku-dhafka:(Starting the Merge Process: ) Habka isku-darku ma bilaaban doono marka uu isbeddel ku yimaado aagga goobta hagaha shaqada(change in the stage area of the working directory) ee mashruuca hadda socda. Waxaad u baahan tahay inaad dejiso oo aad dhammaystirto ficillada sugaya marka hore.
  • Inta lagu jiro Geedi-socodka Isku-dhafka:(During the Merge Process: ) Marka uu jiro ap ap u dhexeeya laanta la isku daray iyo laanta hadda ama degaanka(roblem between the branch being merged and the current or local branch) , habka isku-dhafka ah ma dhammaan doono. Xaaladdan oo kale, Git wuxuu isku dayaa inuu xalliyo khaladka keligiis. Si kastaba ha ahaatee, xaaladaha qaarkood, waxaa laga yaabaa inaad u baahato inaad saxdo mid la mid ah.

Talaabooyinka diyaarinta:(Preparatory Steps:)

1. Kahor intaadan fulin amarrada lagu hagaajinayo qaladka isku-dhafka Git , waxaad u baahan tahay inaad hubiso in mid ka mid ah isticmaalayaasha kale(none of the other users) ee faylalka isku-dhafka ah aysan helin ama aysan wax isbeddel ah ku sameynin.

2. Waxaa lagugula talinayaa inaad kaydiso dhammaan isbeddellada(save all the changes) adoo isticmaalaya amarka go'aanka ka hor inta aanad hubin laantaas ama ka hor inta aanad ku darin laanta hadda iyo laanta madaxa. Isticmaal amarrada la bixiyay si aad u sameyso:

$ git add
$ git commit -m

Fiiro gaar ah:(Note:) Waxaan kugula talineynaa inaad akhrido Qaamuuska Shuruudaha (Glossary)Git(Common Git) -ga Guud ee Shuruudaha & Awaamiirta(Commands) lagu bixiyay dhammaadka maqaalkan.

Git Merge.  Sida loo hagaajiyo qaladka isku darka Git: waxaad u baahan tahay inaad marka hore xalliso tusahaaga hadda

Hadda, aan ku bilowno xallinta Ciladda Tusmada Git ee Hadda(Git Current Index Error) ama Khaladka Isku-dhafka Git(Git Merge Error) .

Habka 1: Dib u habeyn Git Mirge(Method 1: Reset Git Merge)

Soo celinta isku darka waxay kaa caawin doontaa inaad gaarto booskii hore markii aan la isku darin. Markaa, ku fuli amarrada la bixiyay ee tifaftiraha koodka:

1. Ku qor $ git reset –merge oo ku dhufo Gelida.(Enter.)

2. Haddii ay taasi shaqayn wayday, isticmaal amarka $ git reset –hard HEAD oo ku dhufo Gelida(Enter) .

Tani waa inay xaqiijisaa isku darka dib u dajinta Git oo markaa, xalliso qaladka isku darka Git .

Habka 2: Isku-darka laanta hadda ama hadda iyo laanta madaxa(Method 2: Merge Present or Current Branch with Head Branch)

Ku fuli amarrada soo socda ee tifaftiraha qoraalka si aad ugu beddelato laanta hadda oo aad xalliso Git Merge Error :

1. Ku qor git (Enter) git checkout <> ka dibna taabo furaha

2. Ku qor git merge-s sayidkeena(git merge -s ours master ) si aad u fuliso ballan-qaadka midaynta.

Fiiro gaar ah:(Note:) Koodhkan soo socdaa wuxuu diidi doonaa wax kasta oo ka socda laanta madaxa/master wuxuuna kaydin doonaa xogta laantaada hadda oo keliya.

3. Marka xigta, fuli git checkout master si aad ugu noqoto laanta madaxa.

4. Ugu dambeyntii, isticmaal git merge <> si aad isugu geyso labada xisaabood.

Raacitaanka tillaabooyinka habkan ayaa isku dari doona labada laamood iyo cilada index Git hadda waa la xallin doonaa. Haddii kale, isku day hagaajinta xigta.

Sidoo kale akhri: (Also Read:) tus ama qari faylalka isku-dhafka ah ee Windows 10(Show or Hide Folder Merge Conflicts in Windows 10)

Habka 3: Xallinta Isku-dhafka(Method 3: Resolve Merge Conflict)

Soo hel faylalka isku dhaca oo xalliya arrimaha oo dhan. Isku darka(Merge) xallinta isku dhaca waxay ka dhigtaa qayb muhiim ah oo ka takhalusta khaladka tusmada Git ee hadda.(Git)

1. Marka hore, aqoonso faylalka dhibatada sida :(trouble-causing)

  • Ku qor amarradan soo socda tifaftiraha koodka:   $ vim /path/to/file_with_conflict
  • Dhagsi furaha si aad ufuliso( Enter)

2. Hadda, u samee faylasha sida:

  • Nooca $ git commit -a -m ‘commit message’
  • Ku dhufo Gelida(Enter)

Ka dib marka la dhammeeyo tillaabooyinka soo socda, isku day inaad iska hubiso(check out) laanta oo arag inay shaqeysay.

Habka 4: Tirtir Laanta Sababaha Khilaafaadka(Method 4: Delete Conflict Causing Branch)

Tirtir(Delete) laanta oo leh khilaafyo badan oo dib u bilow. Marka aysan wax kale shaqeynin, had iyo jeer waa fikrad wanaagsan in la tirtiro faylasha is khilaafaya si loo hagaajiyo Khaladka Isku-dhafka Git(Git Merge Error) , sida soo socota:

1. Ku qor git checkout -f <> ee tafatiraha koodka.

2. Ku dhufo Gelida(Enter) .

Sidoo kale Akhri: (Also Read:) Isku-dar Google Drive-ka iyo Kootooyinka Sawirrada Google-ka(Merge Multiple Google Drive & Google Photos Accounts)

Qaamuuska: Amarada Git-ga Guud(Glossary: Common Git Commands)

Liistada soo socota ee amarrada Git waxay ku siin doontaa fikrad la soo koobay oo ku saabsan doorkeeda xallinta qaladka Git Merge : waxaad u baahan tahay inaad marka hore xalliso tusahaaga hadda.

1. git log –merge: Amarkan ayaa ku siin doona liiska dhammaan amarrada ka dambeeya isku(Merge) dhaca nidaamkaaga.

2. git diff : Waxaad garan kartaa faraqa u dhexeeya kaydadka gobolada ama faylalka adiga oo isticmaalaya amarka git diff.

3. git checkout: Waa suurtogal in la tirtiro isbeddelada lagu sameeyay faylka, oo xitaa waxaad bedeli kartaa laamaha adiga oo isticmaalaya amarka hubinta git.

4. git reset –mixed: Waxaa suurtogal ah in dib loo dhigo isbeddelada buug-gacmeedka shaqada iyo isbeddelada goobta iyadoo la isticmaalayo.

5. git merge –abort: Haddii aad rabto in aad ku soo laabato masraxa ka hor inta aanad ku biirin, waxaad isticmaali kartaa amarka Git , git merge –abort. Tani waxay sidoo kale kaa caawin doontaa inaad ka baxdo nidaamka isku darka.

6. git reset: Haddii aad rabto in aad dib u dejiso faylalka is khilaafay xaaladdoodii asalka ahayd, waxaad isticmaali kartaa amarkan git reset. Amarkan waxaa inta badan la adeegsadaa wakhtiga isku dhaca.

Qaamuuska: Shuruudaha Git-ga Guud(Glossary: Common Git Terms)

Akhri shuruudahan si aad u barato ka hor intaadan hagaajin Git Merge Error .

1. Checkout- Amarka ama ereygani waxa uu caawiyaa isticmaalaha beddelashada laamaha. Laakin waa in aad ka taxadirtaa isku dhacyada faylalka marka aad sidaas samaynayso.

2. Qaado(Fetch) - Waxaad ka soo dejisan kartaa oo ku wareejin kartaa faylasha laan gaar ah goobtaada shaqada marka aad sameyso Git fetch.

3. Tusmada-(Index-) Waxaa loo yaqaan qaybta shaqada(Working) ama diyaarinta ee Git . Faylasha la beddelay(Modified) , lagu daray, iyo kuwa la tirtiray ayaa lagu kaydin doonaa tusmada ilaa aad isu diyaarinayso inaad samayso faylasha.

4. Isku(Merge) -dhafka - Ka wareejinta wax ka beddelka hal laan oo lagu daro laan ka duwan (caado ahaan sayid).

5. MADAX -(HEAD – ) Waa madax(head ) xafidan (magacaabay tixraac) oo la isticmaalo xilliga ballan-qaadka.

lagu taliyay:(Recommended:)

Waxaan rajeyneynaa in hagahayagu uu ku caawiyay oo aad awooday inaad xalliso qaladka Git Merge: waxaad u baahan tahay inaad marka hore xalliso tusahaaga hadda( Git Merge error: you need to resolve your current index first) . Haddii aad hayso wax su'aalo ah, ku rid qaybta faallooyinka.



About the author

Waxaan ahay injineer software iyo sahamiye. Waxaan khibrad u leeyahay labada Microsoft Xbox 360 iyo Google Explorer. Waxaan awoodaa inaan bixiyo talooyinka khabiirada ee qalabyada horumarinta software-ka qaarkood, iyo sidoo kale inaan caawiyo dadka inay cilad-saaraan khaladaadka Explorer ee caadiga ah.



Related posts