How to fix «Your configuration specifies to merge with the ref 'refs/heads/develop' from the remote, but no such ref was fetched.»?

Why is it happen?

It looks like the Magento 2 team has noticed my previous article: The develop and 2.3-develop git branches now contain an identical code, and deleted the duplicated develop branch:

How to fix the issue?

Step 1.

Rename your develop branch to 2.3-develop:

git branch -m develop 2.3-develop


Step 2.

Prune the orphaned branches:

git remote prune origin


Step 3.

Edit your ./git/config file: change
merge = refs/heads/develop
merge = refs/heads/2.3-develop