Authentication failed to bitbucket

前端 未结 25 935
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-22 23:29

I\'m trying to push my project via the https protocol on bitbucket using sourcetree.
But I can\'t connect to bitbucket with my login and password (which work on the webs

相关标签:
25条回答
  • 2020-12-22 23:56

    This problem occurs because the password of your git account and your PC might be different. So include your user name as shown in the below example:

    https://myusername@bitbucket.org/...

    https: //devi@bitbucket.org/...

    0 讨论(0)
  • 2020-12-23 00:02

    If you got authentication issues with the GIT console, you can try to switch your configuration to HTTPS and specify user & password with the following command :

    https://<username>:<password>@bitbucket.org/<username>/<repo>.git
    

    BUT CAREFUL: Coming back to this answer that I made a very long time ago, I want to give credits to @ChristopherPickslay for pointing out that the password is stored as clear text in the .git/config file.

    If you want to roll with HTTPS, you can securely store your password with Git credential manager

    But personnally, I now always use SSH authentification, as it seems to be a better practice, because you use a personal pair of public/private keys that will prevent your password to be stored outside. Apart from the fact you can put a passphrase on your key, and then you also need to store the password on a credential manager or ssh-agent.

    0 讨论(0)
  • 2020-12-23 00:03

    If you made an account using google/ other oauth, then you need to set a bitbucket password for your account first. The URL for that is : https://bitbucket.org/account/user// or look for Bitbucket settings under the menu.

    Then can login from git (I tried via command line). I use the built in manager for credentials :

    credential.helper=manager

    Now, after I set the password on the bitbucket site (email verified too), and tried to push again, it prompted me for the password, then pushed the code.

    Menu location image on bitbucket web page -> http://ctrlv.in/747291 as of May 2016.

    0 讨论(0)
  • 2020-12-23 00:04

    Tools > Options > Use System Git , then select the git.exe file

    The credentials will be required again, and the problem will be solved.

    0 讨论(0)
  • 2020-12-23 00:08

    Tools -> options -> git and selecting 'use system git' did the magic for me.

    0 讨论(0)
  • 2020-12-23 00:08

    The issue was solved for me after changing the repository password, using no special characters (!"§$%&&).

    Obviously, win-credential-store and git and bitbucket's web interface use different character encodings.

    complete procedure:

    D:\shared\Project> cd /path/to/your/project
    D:\shared\Project> git init
    D:\shared\Project> git remote add origin https://bitbucket.org/USERNAME/project.git
    D:\shared\Project> git-credential-winstore.exe
    

    then

    D:\shared\Project> git push
    Failed to erase credential: Element not found
    fatal: Authentication failed for 'https://bitbucket.org/USERNAME/project.git/'
    

    After changing the passphrase:

    D:\shared\Project> git push
    Counting objects: 102, done.
    Delta compression using up to 8 threads.
    ... etc. ...
    

    Settings in Windows tresory:

    address: git:bitbucket.org (remeber the preceding "git:")
    user: USERNAME
    pass: old incl!"§§$%&, new without!"§$%%&/( (your passphrase!)
    
    0 讨论(0)
提交回复
热议问题