SourceTree won't change Username to push

Ricardost August 30, 2013

Hi There,

I have a simple but bugging problem: I fisrt tried to push files into a Git repository from my SourceTree, but mistyped my Username. Now SourceTree won't allow me to change the incorrect Username when I try to push my work into my Git repository, and so the files will not push.

Thanks in advance!

10 answers

1 accepted

16 votes
Answer accepted
HarryH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 4, 2013

Did you try the "Authentication" tab under Tools>Options, you can modify information of saved users there.

Thanks
Harry

Ricardost September 4, 2013

Yes! That was it... Thanks!

Igor Ganapolsky January 21, 2015

Good approach. The only thing is it doesn't let you save the password there in-place. You have to wait for the login prompt to appear.

jaraco June 1, 2015

Either this is the answer for Windows or it's for older SourceTree versions. On Mac, I had to go to SourceTree | Preferences and select the Network tab.

Like Eoin Mullan likes this
Jason Robinson August 5, 2015

is there a way to manually add another user to SourceTree? I have many different users for GitHub and I need to be able to chose which user to use for a repo.

Tom Bates March 15, 2017

Doesn't work for me. I've so far found no way to restore my correct username. Under Tools->Options->Authentication, both the Saved Passwords and Default User Names are empty - all deleted. I updated the global user.name but it is nowhere to be seen. When I try to Pull the current branch, I get the Authenticate dialog with username "git" which cannot be altered, along with a password entry box.

BTW, the command line works fine. "git fetch origin" and "git pull" complete without error.

karunkamal January 16, 2019

MAC USERS: 

Annwer below by @aixapp is whats needed if you are stuck to change username

15 votes
Jeff Edwards December 8, 2013

1. Under the Source Tree menu, select menu item 'Preferences'

2. Select 'Network' tab

3. Select the hostname you wish to edit

4. Click the 'Edit' button and change the incorrect username.

5. Done!

sidelkovsky April 18, 2014

ThankYouThankYouThankYou! =]

samnau July 11, 2016

This should be the accepted answer.

Pavle Mijatovic January 3, 2017

This worked for me, I was very annoyed and always getting an "Authentication problem bla bla bla..." and didn't notice that the user was wrong.

10 votes
aixapp October 1, 2017

macOS Sierra: 

sourcetree 2.6.3

mainmenu

  - sourcetree

    - preferences 

      - advanced (far right) 

 

then remove (you can't edit passwords) the account where the credentials has changed. 

Screen_Shot_2017-10-01_at_13_31_44.png

duanyulei December 6, 2018

thanks ,i resolve the question by your ways.

Bottle Liang July 1, 2019

I had just registered an account to say thank you.

谢谢大哥。

proutskova June 25, 2020

Thanks!

3 votes
Christopher Prince June 22, 2016

OK-- I figured out at least my problem. There's a little settings button in the upper right of the window. Clicking that let me reset the creds.

Screen Shot 2016-06-22 at 5.44.09 PM.png

DfKimera July 12, 2016

This is actually the only way that to fix it on the Mac, now in 2016. 

2 votes
Shannon Leslie June 30, 2014

In Options -> Authentication, there is a second set of usernames as "default user names". The misspelled one is there. Select and delete it, then the next time you push/clone/etc, you will be reprompted for the username again.

2 votes
HarryH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2013
Please reset the global settings by running:
git config --global user.name "NewUserName"
git config --global user.email "mynew@mail.com"
After that, restart soruce tree to check if it works.
Ricardost September 4, 2013

Hi Harry,

Thanks for your answer - I changed my username in global settings as you suggested (from my SourceTree terminal), and I checked using

git config --list

that it did indeed change. I restarted both SourceTree and my computer.

However, when I drive the "push" command, and SourceTree asks me for authentication, I am stuck with the old username, and my work still won't push :S

I also tried changing username "locally" with

git config user.name "NewUserName"

with the same result.

ricardovigatti February 24, 2016

Your tip was the fix for me, thanks.

Madhu Tomy October 14, 2019

Awesome. This worked for me

0 votes
bposeyyah November 10, 2019

I actually had the settings correct, but what fixed the issue for me on Windows 10 was closing out the tab for the project in Sourcetree and then simply opening it again via the "+" button. Once I did that, the account that was associated with the commits (indicated above the text area for commit message) was shows the correct account (which was already set as my default)

YMMV, but it might be fixed to the account until you close that tab out and reopen it.

 

Version: 3.2.6 on Windows 10

0 votes
hyun_son September 25, 2019

On mac  -> click sourcetree-> preferences -> advanced -> edit or remove your username.

This is on version 2.6.3

0 votes
Christopher Prince June 22, 2016

I'm guessing that many/all of these suggestions (aside from the command line ones) are for the Windows client. E.g., I don't see menu options such as "Tools" with the Mac client.

0 votes
Sudarsan K September 9, 2015

Go to Tools > Options, choose Authentication tab, enter password in password field to reset.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events