How to fix the «Failed to execute git clone... 401 Unauthorized while accessing code.dmitry-fedyuk.com» issue?

The problem could be because of a legacy Git version on your server.

Solution 1

So the first way to solve the problem is just to upgrade Git.

Solution 2

If the problem is not solved with Solution 1 (after Git upgrading), then use SSH authentication instead of HTTP authentication.
You need to register your SSH Key in the Mage2.PRO code repository.
Then redeclare the Mage2.PRO repository to the Composer, but use the https://mage2.pro/ssh URL instead of https://mage2.pro URL:

{
	"repositories": [
		{
			"type": "composer",
			"url": "https://mage2.pro/ssh"
		}
	]
}