'How do I set my password in Sourcetree?

I'm using Sourcetree version 2.1.10.0 as a git gui tool.

When I go to Tools > Options > Authentication, I edit my account, click "Refresh Password" and set my password for my account. I get the message "Authentication OK" in the Edit Hosting Account window.

However, when I select a branch and do a "Fetch" (or any other operation) I receive the following message:

fatal: Authentication failed for 'https://[email protected]/app/demoRepo.git/'

Now when I go back to the Edit Hosting Account page, I see the message "Login failed"

I can re-refresh my password and get the status back to Authentication OK, but it never seems to be applied when I actually try a git command.

Why won't my credentials save? Is there another way to set passwords?



Solution 1:[1]

This is what worked for me. Navigate to C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree and delete (or rename) the file named passwd. Restart SourceTree and execute a command (e.g. Pull, Push, etc..) that requires authentication. SourceTree will then prompt you for your password, rewriting the cached credentials.

Solution 2:[2]

For Mac users :

Go to Preferences ?? Advanced menu and delete the hostname that you want to reset.

After this, you can re-enter your username and password whenever needed (such as pulling from git).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Josh
Solution 2 Ash