0

The problem is that after some commits into different branches, I've got a merging conflict.

I decided to resolve it via PyCharm, but VCS->Git->Resolve Conflicts is disabled.

After, I looked into Local changes and the file with conflicts is blue instead of red.

What is going on and how to resolve my conflicts with PyCharm?

Btw, There are a lot of <<< HEAD parts in this file, as expected.

UPDATE:

Your branch is ahead of 'origin/test' by 50 commits.
   (use "git push" to publish your local commits)
Changes not stated for commit:
    (use "git add <file>..." to update what will be committed)
    (use "git checkout -- <file>..."  to discard changes in working directory)

        modified: directory/subdirectory/filename

no changes added to commit (use "git add" and/or "git commit -a")
smart
  • 1,975
  • 5
  • 26
  • 46
  • Looks like you did something unintended after the merge conflict occurred. Could you add which action caused the conflict (merge, rebase, pull) and what the output of `git status` is? – AmShaegar Jun 03 '18 at 00:07
  • The conflict occurred after `pull`.Git status shows that file with conflict has changed. – smart Jun 03 '18 at 05:49
  • Please copy the exact output to your question. This helps us a lot to understand the current state. You can change filenames if you don't want us to know them. – AmShaegar Jun 03 '18 at 08:00
  • @AmShaegar, updated – smart Jun 03 '18 at 09:07

1 Answers1

1

Looks like something went wrong. IDEs can sometimes do magic things if you accidentally press the wrong button.

I'd go like this:

  1. Reset your current working directory back to your last local revision:

    git reset --hard HEAD

  2. Redo the pull to get the conflict marker back.

    git pull

You should now be able to solve conflicts in your IDE.

AmShaegar
  • 1,491
  • 9
  • 18
  • Didn't reset remove my local changes? – smart Jun 03 '18 at 09:28
  • This removes all uncommitted changes, yes. But as far as I understand you just pulled. So there shouldn't be any changes apart from the ones, the merge is causing. – AmShaegar Jun 03 '18 at 09:30
  • Another thing that just came to my mind: Did you accidentally commit that file earlier with the conflict markers? – AmShaegar Jun 03 '18 at 09:35