4

CodeComit doesn't merge pull request. Says there conflicts, but local and remote branches are up-to-date.

I'm able to create PR fine - CodeCommit says branches are mergeable. enter image description here

But when I click [Merge], it says there are conflicts. enter image description here

And both branches, remote and local, are up-to-date.

What behavior is this? How to solve?

Green
  • 28,742
  • 61
  • 158
  • 247
  • Are there realy no conflict? Try the merging locally and see if it runs successfully – max630 Nov 18 '18 at 04:03
  • 5
    I also face this problem. There are actually no conflicts, it's actually the commits that are behind. Github I think manages it in a much better way. merging develop on my local into the branch and then pushing it again solves the problem for me. – harsh_v Dec 21 '18 at 07:11

2 Answers2

1

I had the same issue and fixed it by squashing and pushing my branch with --force-with-lease.

It appears that CodeCommit can't always resolve branch and resolve merges whilst true git (tm) can

I.e.

commit c
|\
| commit b
|/
commit a

c won't merge

but

reset --soft b
add -A
commit -m "Same commit message"
push --force-with-lease

Does. The code in c hasn't changed but it's heritage has ...

John
  • 11
  • 1
1

CodeCommit only support MergePullRequestsByFastForward now. Such a feature does not exist, at least yet. Every time The solution for this is to do "git pull origin master" locally and publish the branch again.

Jay seen
  • 493
  • 4
  • 14