Kijan pou m rezoud yon "merge conflict" nan Git?

asked 4 months ago239 viewsht

6

Mwen fè git pull e mwen jwenn CONFLICT (content): Merge conflict in index.html. Fichye a gen <<<<<<< ak >>>>>>> ladan l. Kisa pou m fè?

AI diagnosis

AI-generated. Not an answer — the community below confirms or corrects it. Always verify before relying on it.

asked 4 months ago

2 Answers

8
✓
✓ Accepted answer

Pa panike, se nòmal! Sa rive lè ou menm ak yon lòt moun chanje menm liy yo. Git pa konnen kiyès pou l kenbe, kidonk li mande w chwazi.

Nan fichye a w ap wè:

<<<<<<< HEAD
<h1>Byenvini sou sit mwen</h1>        ← vèsyon pa w
=======
<h1>Byenvini sou DevPan</h1>          ← vèsyon lòt moun nan
>>>>>>> origin/main

Etap yo: 1. Ouvri fichye a. Chwazi vèsyon ki bon, oswa konbine yo. 2. Efase makè yo (<<<<<<<, =======, >>>>>>>). 3. Sove, epi:

git add index.html
git commit        # oswa `git rebase --continue` si w t ap fè yon rebase

VS Code montre bouton "Accept Current / Accept Incoming / Accept Both" anlè chak konfli. Sa fasilite travay la anpil.

Si w vle anile tout bagay e rekòmanse: git merge --abort.

Sign in to tell others whether this worked.

answered 4 months ago
6

Pou evite konfli: fè git pull souvan, kenbe branch ou yo kout (kèk jou), epi pale ak ekip la lè de moun ap travay sou menm fichye a.

Sign in to tell others whether this worked.

answered 4 months ago

Sign in and verify your email to post an answer.