Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

fatal: Authentication failed for 'https://my-repo-url.git/'

alberto March 19, 2015

Hi There,

During the past two weeks, after given access to stash and the repo I've started facing the problem in pushing to stash. I'm able to clone the repo, pull from origin master, commit to changes, create and add new files but when it comes the time to push to Stash either a git push or git push origin master don't work.

the returned error is: fatal: Authentication failed for 'repository url'

 

Here is the my terminal code:

AFTER COMMITTING….

On branch master

Your branch is ahead of 'origin/master' by 42 commits.

  (use "git push" to publish your local commits)

 

nothing to commit, working directory clean

ohml-USERNAME:PROJECT-FOLDER USERNAME$ git status <—((CHECKED BRANCH STATUS))

On branch master

Your branch is ahead of 'origin/master' by 42 commits.

  (use "git push" to publish your local commits)

 

nothing to commit, working directory clean

ohml-USERNAME:PROJECT-FOLDER USERNAME$ git remote -v

origin  https://REPO-URL-HERE.git (fetch)

origin  https://REPO-URL-HERE.git (push)

ohml-USERNAME:PROJECT-FOLDER USERNAME$ git push <—((PUSHING))

warning: push.default is unset; its implicit value is changing in

Git 2.0 from 'matching' to 'simple'. To squelch this message

and maintain the current behavior after the default changes, use:

 

  git config --global push.default matching

 

To squelch this message and adopt the new behavior now, use:

 

  git config --global push.default simple

 

When push.default is set to 'matching', git will push local branches

to the remote branches that already exist with the same name.

 

In Git 2.0, Git will default to the more conservative 'simple'

behavior, which only pushes the current branch to the corresponding

remote branch that 'git pull' uses to update the current branch.

 

See 'git help config' and search for 'push.default' for further information.

(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode

'current' instead of 'simple' if you sometimes use older versions of Git)

 

Password for 'https://USERNAME_EMAILDOMAINNAME@stash.acd.com': <—((TYPED MY STASH USERNAME PW))

fatal: Authentication failed for 'https://MY-REPO-URL-HERE.git/' <—((ERROR))

ohml-USERNAME:PROJECT-FOLDER USERNAME$

 

Thanks is advance for your help.

Alberto

3 answers

2 votes
Balázs Szakmáry
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 19, 2015

A few things to check:

  • Your username is your username, not your e-mail address.
  • Is your password correct?
  • Is your account locked?
  • Do you have write permission to the repo?
  • Is there some firewall between you and the server that would stop the authentication?
alberto March 19, 2015

Thanks for your answer Balazs Szakmary. - Password is correct - Account is unlocked - Do have permissions to write - Waiting for a response regarding the firewall. My username is correct I guess, did a more ~/.gitconfig and here is what I got.. [filter "hawser"] clean = git hawser clean %f smudge = git hawser smudge %f required = true [user] name = USERNAME MYNAME = MYNAME <------------- do you know if this should be here? email = USERNAME@EMAILDOMAIN.com

Balázs Szakmáry
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.
April 12, 2015

This .gitconfig looks weird. The MYNAME line should not be there and the name= should be your full name, not your user.

1 vote
Ankit Boghra June 6, 2019

Hey

You may be having your 2 factor authentication on for your github account. If yes, you need to add SSH key, or disable 2 factor authentication.

tpuvvara November 21, 2019

It worked! Thanks!

0 votes
Ashutosh Kumar November 5, 2020

Hi,

This happens when you change your system password and github is not taking system password automatically.

you need to manually change the password here:

Control Panel --> Credential Manager --> Manage Windows Credentials --> Choose the entry of the git repository, and Edit the user and password.

Thanks

Spilka Polina November 15, 2020

This solution helped me! Thank you so much!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events