Can't merge pull request in AWS CodeCommit. Complains there are conflicts, but remote and local are up-to-date

Viewed 2759

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?

2 Answers

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 ...

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.

Related