Kelson Olson
Kelson Olson

Reputation: 152

GIT commands fatal errors Unable to access 'https://mygiturl/': The requested URL returned error: 400

The last few days I have been doing a huge file/solution/project migration, changing my files from asp.net mvc to net core mvc. I just started using Visual Studio Community 2017 and installed it yesterday, but I get these errors now even if I run them using the Windows command prompt. I have previously been able to push commits just fine. Everything including the IDE is running in administrator mode. I am logged into Team Explorer and logged into my project GIT online. Executing any commands which communicate to my https GIT site return 'The requested URL returned error: 400'

In the windows command prompt I tried running:

It turns out I'm able to push the commits using VS2015. Everything else still errors due to some problem I have still been unable to find.

Upvotes: 0

Views: 3091

Answers (2)

Kelson Olson
Kelson Olson

Reputation: 152

There was a space in my project name. Why there was no problem in VS2015 is still beyond me. I ended up setting up a new project and repository without a space in the name and manually copied over the files for the first push attempt which succeeded using Team Explorer from within VS2017.

Maybe Microsoft should rethink how they let someone setup a project within VSTS because the input allows spaces and even seems to encourage it (proper naming), but apparently that throws a wrench into GIT.

Upvotes: 1

VonC
VonC

Reputation: 1324148

Check first if you have a credential helper activated:

git config credential.helper

On Windows, that could be the Credential Manager, which could have incorrect credentials cached in it.

Try also to add your username account to the remote URL

git remote set-url https://<username>@server/account/repo

Upvotes: 0

Related Questions