Sourcetree remote: Invalid username or password

前端 未结 15 1252
失恋的感觉
失恋的感觉 2021-01-30 00:16

Im trying to push to github with sourcetree but get the following error:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin

相关标签:
15条回答
  • 2021-01-30 00:43
    1. Delete your saved account in tools\option dialog.
    2. Push or pull again, and SourceTree will ask you to input your login name and password.
    0 讨论(0)
  • 2021-01-30 00:43

    In my case, this happened on one of my two computers after I switched to OAuth on GitHub. The error message was referring to git-credential-manager.exe, which is located in AppData\Local\Atlassian\SourceTree\git_extras. I noticed that the version on my working machine is from 2018, whereas the one on the non-working machine is from 2017. Both run the newest version of SourceTree (3.0.17). This is what I did to get it to work:

    1. Uninstall SourceTree
    2. Since this did not remove AppData\Local\Atlassian\SourceTree, I deleted that entire directory manually
    3. Updated git to the newest version (neat: >git update-git-for-windows) - probably not necessary but a good idea anyway
    4. Re-installed SourceTree
    5. Added existing local repos
    6. Fetch - and finally, after entering username and password (twice, if memory serves), I get asked for the OAuth token. Yipee!

    Surprisingly, AppData\Local\Atlassian\SourceTree\git_extras was created, but is now empty...

    0 讨论(0)
  • 2021-01-30 00:45

    I just solved this problem by using an access token. I use macbook, all answers above didn't work for me. Go to your github account, click your profile image on right top corner, then click:

    Settings -> Developer settings -> Personal access tokens -> Generate new token

    Paste this token into sourcetree popup window, required password area, instead of typing your account password. Github uses two step verification, so you need to use a token rather than account password. Good luck! Let me know if this works for you.

    0 讨论(0)
提交回复
热议问题