Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

'Unknown' User in Sourcetree

Jen Connor December 16, 2013

I am currently testing out stash and I came across an issue where I download Sourcetree and set my credentials (Name and email) for the use of having a Author on commits. Every time I commit, it shows my author as 'unknown<mycomputername>'. I looked up this issue and it seems like one other person came across this, but was able to solve it by reentering their data under Tools-> Options. The only way I can fix this issue is by going to Repository -> Repository Settings -> Advanced and unclicking 'Use global user settings'. Can anyone explain to me the source for this issue? Is there a way to prevent this from occurring?

3 answers

1 accepted

11 votes
Answer accepted
Aseem Parikh
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.
December 20, 2013

I'm no Sourcetree guru, but it seems like you did everything right initially.

You should be able to set your username and email globally for git through the command line though.

git config --global user.name "Jennifer Connor"
git config --global user.email "your@email.com"

At least this way you'll be spared from needing to do this for each repo.

Jen Connor January 30, 2014

Aseem, I appreciate this response. I decided to try using git command line and it has worked quite well. It has also solved the issue with SourceTree so I will recommend users go with this approach during their setup.

Aseem Parikh
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.
January 30, 2014

Jen, I'm glad it worked out so well for you. Always happy to help.

Eswara August 25, 2015

Worked like a charm. Thanks a ton.

Andrew Kaser September 29, 2015

just fixed my problem at work today, thanks :)

2 votes
msillence March 26, 2015

Another option is to edit the file:

C:\Users\<Username>\AppData\Local\Atlassian\SourceTree\git_local\etc\gitconfig

a hidden folder by default...

Add the lines:

 

[user]

    name = &lt;My Name&gt;
0 votes
usulcap October 13, 2014

I have the same problem, but the accepted solution does not work for me. Neither does the workaround of the original poster.

Problem: When pushing unknown<mycomputername> is used.

  

remote: refs/heads/Feature-QCP-1055-plq-40k-80k-refactored:
96374b247370a007554fb59efbf4b85526c27bb0: expected committer email
'firstname.lastname@capgemini.com' but found
'shortname@computername'[K

remote:
refs/heads/Feature-QCP-1055-plq-40k-80k-refactored:
96374b247370a007554fb59efbf4b85526c27bb0: expected committer name 'firstname
lastname' but found 'unknown'[K

 

The author name and e-mail is configured in Tools -> Options -> General.

In Repository -> Repository Settings -> Advanced it does not matter if 'Use global user settings' is checked or not.

Using Sourcetree version 1.6.5.0 with embedded GIT 1.8.3.

 

Anna Knowles October 27, 2014

I had a similar error after updating Sourcetree, and updating the git.config (global, local and system) to the correct user name and email didn't help. It turned out that the commit that I wanted to push had been made with the wrong name and email, so the remote wouldn't accept it. Running git commit --amend --reset-author fixed the problem once the correct information was in the config file (or in the Sourcetree options, which are equivalent).

Dinko Šego July 11, 2017

Thank you very much. I was struggling with this for hours and this was the answer.

So, setting user and email in the Advanced window on Repository Settings and after that deleting local master branch and checking it out again was solution.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events