-
I've just resolved the merge conflict
by moving my change of splitting
-
the asteroid into two fragments into
the new breakIntoFragments function.
-
However, I still need to let git
know that the conflict is resolved.
-
I can do this by
committing the resolution.
-
First I'll save the file.
-
Then I'll go back to the command
line and run git status.
-
This time, instead of showing
game.js as simply modified,
-
git shows the file was both modified.
-
That's because both branches modified
the file and then there was a conflict.
-
I resolved the conflict, though, so
I'll add the file to the staging area.
-
Now I'll run git status again, and
git says, all conflicts are fixed but
-
you are still merging.
-
Use git commit to conclude the merge.
-
So I'll go ahead and
-
do that, and once again git has already
filled in a commit message for me.
-
This time it notes that I just merged
the master branch into easy-mode, and
-
that there was a conflict in game.js.
-
Like before, I could change
this message if I wanted to.
-
But this message describes
the commit well, so
-
I'll leave the message as it is and
quit.
-
Now I'll run git log.
-
Notice that only one
new commit was created.
-
Git didn't create a separate merge
commit and a conflict resolution.
-
Instead, it just put them
both in the same commit.
-
Now to get practice resolving
a merge conflict, go and
-
merge master into easy-mode
on your own computer.
-
When you're done,
run the command, git log -n 1 and
-
paste the output in this box.
-
The -n flag means that git log will
only show that number of commits,
-
in this case, one.