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

How to fix the issue?

Step 1.

Rename your develop branch to 2.3-develop:

git branch -m develop 2.3-develop

Details: stackoverflow.com/a/6591218

Step 2.

Prune the orphaned branches:

git remote prune origin

Details: unix.stackexchange.com/a/124475

Step 3.

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