HTTP authentication failure on push

Andy Hardy March 27, 2013

Running on Windows 7.

I have a bare repository at http://locode01:8080/scm/git/hpmis_calc_engine and a local clone.

When I try to push from my clone I am asked for my password: the username box is pre-populated with the name of the repository host 'locode01'. Naturally, this push fails.

The full output for the push command is:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master
Pushing to http://locode01:8080/scm/git/hpmis_calc_engine

fatal: Authentication failed

Pushing to http://locode01:8080/scm/git/hpmis_calc_engine

fatal: Authentication failed

Pushing to http://locode01:8080/scm/git/hpmis_calc_engine

The same repository pushes correctly when using TortoiseGIT, GIT cli, etc. - in each case I am asked for the username and password.

How do I specify the HTTP authentication username in Sourcetree?

1 answer

1 accepted

0 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 27, 2013

You can specify the username just by pre-pending it to the url like this:

https://username@host/path/to/repo

However when I test a https URL here without specifying the username, I get prompted for the username too. The way ST does this is it checks to see if the prompt from git asks for the username or just the password, so I'm not sure why it's getting that wrong. Will tryt o reproduce.

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 27, 2013

Ok, so the problem is that when you include the port in the URL a username is incorrectly derived from the hostname. It doesn't happen if the port is standard. Logged as a bug: https://jira.atlassian.com/browse/SRCTREEWIN-415

I've also confirmed that adding the username to the URL as shown above works around the problem in the mean time.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events