FAQ: Git Branching - merge conflict II

This community-built FAQ covers the “merge conflict II” exercise from the lesson “Git Branching”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn Git

FAQs on the exercise merge conflict II

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

In section 9/10 of Merge Conflict II, the left column instructions state “In the code editor, look at resume.txt” to see a listing of the differences (with markings) between the “master” and “fencing” branches. What command do I enter to get the “code editor” to show this? This appears in
https://www.codecademy.com/courses/learn-git/lessons/git-branching/exercises/merge-conflict-2?action=resume_content_item .
Also a general item: when entering git commands and getting git messages, the column space fills up and messages become hidden past the bottom of the screen. There is no way to scroll up the messages. (I am accessing git under Red Hat Enterprise Linux using Mozilla Firefox.) It took me a long time to discover that when space fills up, I should click on the X [in X bash] at top of column which clears the column. Then a “new Session” box appears; click on box to resume typing commands. VJS

3 Likes

In section 8/10 of merge conflict II, the left column instruction states that - "In the code editor, look at resume.txt . Git uses markings to indicate the HEAD (master) version of the file and the fencing version of the file, like this:

<<<<<<< HEAD
master version of line
=======
fencing version of line
>>>>>>> fencing

But no markings or differences like above are being shown.
What should i do to get this?

3 Likes

I used “nano resume.txt” to view the file within the terminal, then make the changes, save, exit, add, commit, then merge, then delete the branch.

1 Like

I clicked ‘back’ to the previous exercise then ‘next’ to return to ‘merge conflict II’ and it seemed to work. I also turned of uBlock Origin (adblocker), though unsure if that made a difference.

1 Like

In scection 8/10 closing the resume.txt and open it again in the implemented file explorer worked for me to display the new markings.

In 8/10 - 5, when i tried to commit the changes, i got a

fatal: cannot do a partial commit during a merge.

Adding the parameter -i in the commit worked for me. Don’t know exactly what went wrong…

git commit -i -m “Resolve merge conflict”

Heres a quick explanation of the parameter from Git - git-commit Documentation :
-i
–include
Before making a commit out of staged contents so far, stage the contents of paths given on the command line as well. This is usually not what you want unless you are concluding a conflicted merge.

I ended up just skipping that step after running “git status”. Hope that helps!

1 Like

same problem and just skipped running the “git status” command . Thank you @erinwmccall

hi

i have question regarding the following merge conflict II topic. After fixing the Resolve merge conflict what about the git log condition for both branches.

Isn’t both branches master and fencing will have exact same number of logs just like the first time we made the fencing branch from master.

Kind Regards

You can also just type clear, and the terminal will clear without erasing your comands history.

Stage the content of paths? What does that mean?

Stage them on the command line as well? How else would one stage something?

I don’t understand what you’re saying at all

They tell you that in order to see the changes, you need to close the resume.txt file by clicking on the X on the tab at the top of the file editor. Then click on the file navigation folder that’s to the left of the tab you just closed and reopen the file named resume.txt. The changes should then be visible.