Information

Author(s) Mathieu Jadin
Deadline No deadline
Submission limit No limitation

Sign in

Git: Resolve conflicts

In the previous task, you merged your local history with the remote one with no conflicting changes.

Indeed, if you have two commits in different histories that modify the same line of a file, git is unable to figure out which version is the right one.

https://inginious.org/course/git/git-merge-conflict/git-before-pull-2.svg

Therefore, it will prepare a staging zone with the modifications without any conflict and and it will ask you to manually solve the remaining conflicts.

To help you, git writes in each conflicting file the conflicted lines, highlighted with <<<<<<<, ======= et >>>>>>>. First, it inserts the local version and then inserts the remote version. For instance:

<<<<<<< HEAD
Your local change
=======
The incompatible change on the remote copy
>>>>>>>

Once the conflicts are solved, you need to add the changes to the staging zone and the create the merge commit in the local copy:

https://inginious.org/course/git/git-merge-conflict/git-after-pull-2.svg

Finally, you may push your local history to the remote copy.

https://inginious.org/course/git/git-merge-conflict/git-after-push-2.svg

Téléchargez l'archive qui contient déjà un repository cloné dans le sous-dossier clone. Synchroniser-le avec son repository distant, résolver le conflit. Le contenu des deux commits doit être concaténé.

Une fois que c'est fait, ré-archivez le dossier complet et uploadez-le.

Le message du commit de fusion devra être "MERGE".

Notez que le repository "distant" dans cet exercice n'est pas sur github ou dans bitbucket mais dans le dossier bare.git de l'archive.

Votre soumission devra avoir l'architecture suivante:

git-merge-conflict/
├── bare.git/
|   └── [...]
└── clone/
    └── [...]

Max file size: 1.0 MiB
Allowed extensions: .zip