Abdullah Ch
Abdullah Ch

Reputation: 101

How to fix this error " fatal: protocol '[https' is not supported "?

I am re-initializing my rep,adding my code into it but still , when I push it...I get this error....

When I was looking for the solution , I saw in one of stackoverflow's post that after origin , the space is not actually space but some special character, but I had put a space for saafekeeping, still The error is not not fixed..... git remote add origin https://github.com/abdullah-ch/Graphical-User-Interface-in-JAVA.git

git init

git remote add origin https://github.com/abdullah-ch/Graphical-User-Interface-in-JAVA.git

git remote -v origin [https://github.com/abdullah-ch/Graphical-User-Interface-in-JAVA.git] (fetch) origin [https://github.com/abdullah-ch/Graphical-User-Interface-in-JAVA.git] (push)

git add .

git push origin master

// Then I get this error

fatal: protocol '[https' is not supported

My java code is not being pushed to my rep

Upvotes: 1

Views: 10485

Answers (1)

bk2204
bk2204

Reputation: 76964

You've placed brackets around the URL, which is not valid syntax, and Git is interpreting the brackets are part of the URL. Consequently, pushes don't work.

You should set the URL such that it doesn't contain the brackets:

git remote set-url origin https://github.com/abdullah-ch/Graphical-User-Interface-in-JAVA.git

If you still have this problem after doing that, it's possible that you may have set the URL in your global configuration file. You can look at the places this value is set by running the following:

git config --show-origin --get remote.origin.url

Find the file which contains the faulty URL (the one with brackets) and edit it to remove that configuration option. Then try setting the origin remote again, once you're back in your repository.

Upvotes: 1

Related Questions