1

Failed to push existing git repository to remote.

It did not happen before. I have tried install the last version of git but still fail to push.

git push --set-upstream origin master
git: 'remote-httpshttps' is not a git command. See 'git --help'.
SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
Mas Zero
  • 503
  • 3
  • 16
  • 1
    You have just a new branch (`master`) that you want to push? Or how should to understand `"git cannot push an existing repository..."`. Or is the `master` branch already a *remote-branch*? – SwissCodeMen Jan 08 '21 at 12:09
  • 2
    `remote-httpshttps` is rather suspicious. Please see `git remote show origin` and fix the URL by removing double `httpshttps://` – phd Jan 08 '21 at 12:25

2 Answers2

1

Not sure why..... I closed the git bash, and opened a new one. Then it was fixed:(

Mas Zero
  • 503
  • 3
  • 16
0

If you have the HTTPS URL of your remote repository, try first:

git remote set-url origin https://url/of/remote/repository

Then try again the git push -u origin master.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • actually whatever git command i give, it always `git: 'remote-httpshttps' is not a git command.` ... and it was just fixed by re-opening a new bash:( – Mas Zero May 12 '21 at 21:15