1

I'm using IntelliJ IDEA and I'm not sure where I'm going wrong, but I have another coder working on a section of an app (a branch called "additionalwork") that is on GitHub. All I want to do is to look at what he's doing before merging what he's done into the master branch. For some reason, when I make changes to my code and try to commit, I get an error:

enter image description here

Could someone tell me the steps I should be doing (or avoiding) so that I can not only work on my section of code, but view the other branch and then merge into the master branch if everything is ok with the other coder's work?

2 Answers 2

3

Please check the following:

  • In right lower corner you will see yellow sign with Merging
  • Under active changelist there should be "Merge conflict" tab with 'Resolve' Button, click on that.

Please resolve the conflict and then try to commit again.

Sign up to request clarification or add additional context in comments.

Comments

0

Without knowing exactly how you ended up in this state, just look at the error message from IntelliJ:

Committing is not possible because you have unmerged files.

You would typically end up in this because you did a git pull (or a merge with some branch), and ended up with merge conflicts. Therefore, the git pull/merge did not actually commit and complete, because Git expects you to manually resolve conflicts, and then commit yourself. So, to get out of this situation, you should resolve the conflicts and then git add each file from the bash or from IntelliJ, followed by a commit to complete the pull/merge.

One quick way you may identify which files in your project are in conflict would be to search for a merge conflict marker across your entire project in IntelliJ. So, try doing a SHIFT + CTRL + F for:

<<<<<<<
or
=======
or
>>>>>>>

2 Comments

Neither three markers are found. How do I find these "files" and merge them?
The error message is clear. You should run git status from the bash to see what is going on.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.