Why do SourceTree prompt for user git when using SSH
Asked by tkhduracell:

I'm using SourceTree with my native system Git, that have all SSH keys setup. Running *git push / git pull* from the terminal works fine, but using the SourceTree buttons it prompts for a git user.  
My question is really how to get this working...  

Screenshot 2015-04-01 10.42.22.png

```
filip?~/GitMigration/test(master)? git remote -v
```

```
origin?git@git.company.com:main/devops.git (fetch)
```

origin [git@git.company.com](mailto:git@git.company.com):main/devops.git (push)
Pushing from terminal {#toc-hId-1618820708}
-----------------------------------------------------------------------------------------------------------------------------

```
filip?~/GitMigration/test(master)? git push
```

```
?Counting objects: 6, done.
```

```
Delta compression using up to 4 threads.
```

```
Compressing objects: 100% (5/5), done.
```

```
Writing objects: 100% (6/6), 943 bytes | 0 bytes/s, done.
```

```
Total 6 (delta 0), reused 0 (delta 0)
```

```
To git@git.company.com:devops/devops.git
```

```
?? 27d45ef..f834554? master -> master
```

```
filip?~/GitMigration/test(master)? which git
/usr/local/bin/git
```

Pushing from Sourectree {#toc-hId--933336253}
---------------------------------------------

It prompts for the git user password, I press cancel trice:  

```
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags origin refs/heads/master:refs/heads/master 
Pushing to git@git.company.com:main/devops.git
2015-04-01 10:58:28.811 SourceTreeLogin[1133:2214511] Error (internetKeychainItemForServer:withUsername:path:port:protocol:) - The specified item could not be found in the keychain.
User cancelled password prompt.2015-04-01 10:58:30.580 SourceTreeLogin[1133:2214511] User cancelled password prompt.
Permission denied, please try again.
2015-04-01 10:58:30.656 SourceTreeLogin[1134:2214552] Error (internetKeychainItemForServer:withUsername:path:port:protocol:) - The specified item could not be found in the keychain.
User cancelled password prompt.2015-04-01 10:58:32.450 SourceTreeLogin[1134:2214552] User cancelled password prompt.
Permission denied, please try again.
2015-04-01 10:58:32.510 SourceTreeLogin[1146:2214673] Error (internetKeychainItemForServer:withUsername:path:port:protocol:) - The specified item could not be found in the keychain.
User cancelled password prompt.2015-04-01 10:58:33.601 SourceTreeLogin[1146:2214673] User cancelled password prompt.
Permission denied (publickey,password).
fatal: Could not read from remote repository.
```

```
Please make sure you have the correct access rights
and the repository exists.
Completed with errors, see above
```

#### Versions {#toc-hId-416447072}

git version 2.3.2  
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011  
SourceTree version 2.0.5.2 (2.0.5.2)  
[](https://community.atlassian.com/t5/Sourcetree-questions/Why-do-SourceTree-prompt-for-user-git-when-using-SSH/qaq-p/133940?attachment-id=9622){#link_116a6fda4d90a3}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/3985/1/Screenshot%202015-04-01%2010.42.22.png){#display_116a6fda4d90a3_0}


Answers:
author: Gabriel Cook
body: I had a similar issue and needed to provide my password for my SSH key (id_rsa). The prompt was not clear for me, but that did resolve it.


author: Grant Kemp
body: Basically Source tree has a major problem processing accounts if you have 2 factor or use things like app passwords I logged a question previously - and was told how to to use app passwords - but the problem is that Sourcetree is has a major bug which they aren't fixing.

I am moving to an alternative git client till they add proper support for 2 factor or improve their implementation to remember passwords.


author: tkhduracell
body: ```
I've tried with this configuration, but it still prompts for git user
filip?~/GitMigration/devops(master)? git remote -v
```

```
origin?ssh://git@git.company.com:main/devops.git (fetch)
```

```
origin?ssh://git@git.company.com:main/devops.git (push)

If I use this:
```

```
filip?~/GitMigration/devops(master)? git remote -v
```

```
origin?ssh://git.company.com:main/devops.git (fetch)
```

```
origin?ssh://git.company.com:main/devops.git (push)
```

```

We use GitLab, and it explicitly tell me to use:
git@git.company.com:main/devops.git
```


author: Tim Crall
body: I always use git@ when doing SSH. Have you tried putting ssh:// into the URL, though?

comments: author: tkhduracell
body: "I don't handle ssh://" it says.


author: Silviu Burcea
body: If you [change the remote url](https://help.github.com/articles/changing-a-remote-s-url/) to

```
someUserName@git.company.com:devops/devops.git
```

it should not ask you for username anymore.