20 thoughts on “Updating SourceTree Git Login Credentials Leave a comment

  1. Hi,

    I tried this but it doesn’t work at all. Every time I do a git pull or push in the terminal, it keeps asking me for username and password which is quite annoying. What version of Sourcetree are you using?

  2. Thank you for this! If you’re working on a Mac, like I am, I think this updates the credentials correctly in Keychain Access. I tried to do it manually but it didn’t seem to work until I followed your steps.

  3. I know this is a really old post. But I deleted the references in keychain, restarted SourceTree, it asked for password and now it’s all good.

  4. @Ben, I also appreciate that this is an old post, and I followed your instructions, but the problem persists for me. I noticed that when I enter my credentials on the command line, there is a keychain entry for tfs.host.com, but when I enter them in SourceTree there is a new keychain entry for tfs.host.com:8080. Yet, SourceTree asks me for my password multiple times each time I pull.

    I’m on SourceTree 2.3.1, Mac OS 10.11.6.

    1. Must admit I haven’t tried to do this in a long time. I now have Github Desktop installed for Github and SourceTree for everything else. Just makes it simpler 🙂

  5. The solution didn’t work for me.
    What did work is update my credentials using Tools->Options->Authentication

  6. Where does the Authentication cache information is stored in source tree.
    when user is trying to push to GitLab it is taking wrong user id and trying to push

  7. @Ben Harvey, your suggestion to delete the keychain reference saves me every time. Thanks!

    Git pull did not work because I had already cloned and had the latest. However was able to add a commit and then issue Git Push. Was prompted for User Name and Password.

    Note that if you have 2FA on your github account, you will need to use Personal Access Tokens instead of password.

  9. Deleting the sourcetree keychain entry on my mac helped to re-enter my new password.
    Thanks for the help!

  10. It’s pretty clear to me that Atlassian does not want people to use git – hence the ever trouble of updating a simple password for the past 5 years or more. Just use github desktop instead.

    1. What about bitbucket? Personally I tend to swap between SourceTree and the Github client now – depending upon who is hosting the repo.

  11. This actually worked like a charm, had been looking to how do this and could not for the life of me find out how to do this. Thank you for posting this

  12. I used to do the terminal method and it used to work. Now it didnt. So I tried removing the entry in my keychain (Mac) and did a pull. It asked me for my password and now it works like a charm.

  13. If using Sourcetree on Windows, none of the other tips worked for me when I need to update credentials, but deleting:


    did work. I was prompted for the new credentials on the next pull. Note this was for a generic git repo, not github or bitbucket.

Leave a Reply

Your email address will not be published. Required fields are marked *