Since I’m having fun with these software micromaterials, I thought I’d continue on with another simple one.
Along with working on rebasing, resolving merge conflicts is another thing that learners new to
git need to work on.
If you want the longer explanation, you can go straight to the Github repository, but the short version is as follows:
- Two people are working on the same project
- Person A changes a line in a file
- Person B changes the same line in the same file, but in a different way
- When they try to combine their changes, it’s not clear which one is the right one
There are numerous tutorials and blog posts on how to do this, but the added benefit of the micromaterials approach is that it involves doing an authentic task and getting immediate feedback.
Basically, the learner copies the project to their local computer, and runs through the commands in the command prompt. It is a very simple step-by-step walkthrough, intended to model the process of resolving a real merge conflict.
There are two files that will have merge conflicts, and these need to be fixed by the learner:
If they haven’t yet resolved all the conflicts, a helpful feedback message will tell them so:
After successfully resolving all the conflicts, there is immediate feedback on their success:
Having an experienced
git user help you do stuff like this is clearly the best way to learn, but there isn’t always time for this, or even somebody to help if you’re learning on your own, so I thought this could be one more potential tool that could be available for new learners.