How to resolve fatal: Authentication failed for git [bitbucket]

81.3k Views Asked by At

I have been facing issue when i fetch or pull in any client. i.e "Tower" and Sourcetree. Everything was going smoothly , i did just update macos into Mojave.

But I always get

Error details: fatal: Authentication failed for 'https://[email protected]/sample/sample.git/'

3

There are 3 best solutions below

2
flik On BEST ANSWER

You can try this solution:

git remote add origin https://{username}:{password}@github.com/{username}/project.git
1
Philip Oakley On

The best approach is to use the Git Credentials Manager (https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.18.1), or the appropriate cred manager for your OS. Don't put your username/password in the plain text config file (unless it is double blank..)

2
frmbelz On

The same error (Windows, Git Bash command line, bitbucket). Using https (not ssh) which should prompt for login credentials but instead errors:

$ git pull origin master
fatal: Authentication failed for 'https://bitbucket.../my_git_project.git'
$ git config -l
...
credential.helper=manager
...

$ git config --global --unset credential.helper
$ git config --system --unset credential.helper

git pull now prompted for username/password.