Skip to content

Updating SourceTree Git Login Credentials

At work we use Git for versioning our code. We also use the suite of Atlassian products for managing tasks, code, and deployment. As such I use SourceTree a lot to manage my code. We’re also security conscious and so we have to change our passwords every couple of months – however this then breaks SourceTree.

What I mean is, when I change my password SourceTree doesn’t remember the change and so I have to enter it every. single. time.

Having Googled how to solve this 3 or 4 times now I thought I’d make a note on my blog so I can more quickly find the solution (hopefully the act of writing it down will mean I won’t have to Google it again).

The solution is actually quite simple once you realise – but doesn’t use any of SourceTrees dialogs.

  1. Open SourceTree and navigate to the repository you want to update the password of
  2. Run the ‘Actions > Terminal’ command to jump to the location of the repo on the command line
  3. Enter ‘Git Pull’ and hit return to update the repository
  4. When requested enter your password
  5. Done


Tips, Web Design

Ben View All

Ben is a lifelong Nintendo fan who also likes to build websites, and develop games. He also buys way too much Lego.

16 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, but when I enter them in SourceTree there is a new keychain entry for 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.

  5. 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

    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.

  7. 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.

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

Leave a Reply

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