SourceTree to GitHub Enterprise
Asked by dustinplatter:

Hi all. I have read a number of the post on this site regarding the subject, so if I'm overlooking something I apologize but I have tried to resolve this before asking the question.  

I am using SourceTree 3.1.2. I am trying to connect to my companies GitHub Enterprise account. However, I'm not able to get anywhere. Putting the things I've tried below. Step by step instructions would be appreciated, cause my bumbling attempts aren't working.

**Add Account**

1. Select Remote
2. Click Add an Account
3. Select GitHub Enterprise
4. Host URL = github.build.mycompany.com/Project/repository
   1. for SSH it's = git@github.build.mycompany.com:Project/repository.git
5. I have tried both HTTPS and SSH
   1. Loaded my private key into SourceTree via Putty Key Generator and copied the Public Key over to GitHub Enterprise (including the first line 'ssh-rsa...'
   2. SSH client Config has key loaded and SSH Client set to Putty/plink with Auto-start on
6. Put in the userID from github
7. Hit Refresh Password and put in my GitHub password
8. Authentication Failed, Failed to check login for user

**Clone**

1. I have also tried close with the below (SSH path is unregognize)
   1. <https://github.build.mycompany.com/Project/repository.get>
2. I get prompted for git credential
3. But it results in 'Repository Type: This is not a valid source path/URL'
   1. The details seem to indicate that Password Auth is not available and to use a SSH key (which I've already set up.


Answers:
author: Joel Louie Miranda
body: Hi guys, I am having the same problem and has pasted the errors I got on this link.

But, repasting the error here again.

<https://community.atlassian.com/t5/Sourcetree-questions/Github-Enterprise-Login-Unexpected-char-encountered/qaq-p/1079585>

> Unable to parse the response from the host service.  
> Please check the host url details for this account. It's likely that Sourcetree tried to contact an unrecognized service.  
> Unexpected character encountered while parsing value: \<. Path ", line 0, postion 0.

I am really hoping this can be fixed soon please

comments: author: Anmol Jain
body: I am able to clone to repo from Github enterprise using the below method

![Annotation 2019-12-11 141938.png](https://community.atlassian.com/t5/image/serverpage/image-id/75958iA985000AAF347E79/image-size/large?v=v2&px=999 "Annotation 2019-12-11 141938.png")


author: Sara
body: Thanks, this solved my issue!


author: NumericOverflow
body: +1 [@Anmol Jain](/t5/user/viewprofilepage/user-id/3670987) suggestion solved my issue too.

Can someone from Atlassian put this in the documentation perhaps? Seems like a very common situation to require digging through forums instead of the official docs on how to connect.


author: sandeep teerth
body: Anmol jain, thanks a ton for this post , i was annoyed of using github desktop app with github enterprise.... this soultion works for tortoise git also. Super solution. Thanks a ton :)


author: Damayanti Gupta
body: Where is the solution?


author: Anmol Jain
body: please see my previous post in this thread for solution. or let me paste the solution again for reference. Please observe the first textbox in the screenshot below.

![Annotation 2019-12-11 141938.png](https://community.atlassian.com/t5/image/serverpage/image-id/75958iA985000AAF347E79/image-size/large?v=v2&px=999 "Annotation 2019-12-11 141938.png")


author: tayyabhussain
body: [@Anmol Jain](/t5/user/viewprofilepage/user-id/3670987) whats personal_token?

Edit: Nevermind, got it, thanks


author: Anmol Jain
body: It's the personal access token that you need to generate from GitHub user profile section


author: Ana Retamal
body: Hi Dustin!

Welcome to the Community and thanks for your super detailed description, this really helps us get faster to the root cause of this issue. I can see that you're having difficulties trying to connect and clone from your Github Enterprise account, there're a few more things we need to know to continue helping you with this:

1. Which operating system are you using?
2. Which browser are you using? If you're using Internet Explorer, can you confirm that it's updated to the latest version? We've seen authentication issues when the version was an older one.
3. In both examples, you got an error during the authentication. Can you try logging into your Github account directly via the browser and double check that the credentials you're using are the right ones?
4. Are you using 'Embedded Git' or 'System Git'? Which Git version do you have? (You can find this at **Gear \> Accounts \> Git**)
5. For troubleshooting purposes, are you able to clone from that account directly using the command line?

Let us know! Once we get the responses we'll be able to troubleshoot this issue with you.

Kind regards,

Ana

comments: author: dustinplatter
body: Good morning Ana,  

I'm running Windows 10 Pro 64-bit. As I mentioned I'm trying to get my 3.1.2 SourceTree to connect to a GitHub Enterprise account. So Browser is not really part of the equation.   
I am able to clone the repository using GitHub Desktop, but not SourceTree. I'm actually hoping to get my team to switch from GitHub Desktop to SourceTree, but not being able to connect is a bit of a hurdle ;).   
Credentials is the one area I'm unsure about. I've tried using both my GitHub login/password, as well as the Personal Access Token I've created specifically for Stash. Neither works. I have created multiple PAT to ensure that I'm using the correct string, but neither works. I am also positive I'm using the correct username/password.

In both cases I get the below message.  
![SourceTreeLoginError.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/53614iF7917305705471AA/image-size/large?v=v2&px=999 "SourceTreeLoginError.PNG")


author: dustinplatter
body: Hello Ana. I was wondering if there has been any update following the additional information I've provided?   
I used SourceTree extensively at my prior company and I think it would greatly benefit my new team. I'd love to work with you to resolve this issue and be able to show my team the benefits of your product.

Thanks


author: alex gonzalez
body: I have exactly the same problem, the only difference is that I use Windows Enterprice but I don't think it's important.

As additional information, I use Symantec double factor authentication (VIP Access). I think that could be the problem ...


author: Xavier
body: Same here.

Works on Mac but not windows :(


author: Kakit Law
body: Encountered the same error message today and struggled a bit with combinations of username/email + password/PAT.

Found the solution by importing "remote repositories" in sourcetree \> remote tab \> Add an Account.

![2023-01-13_12h43_30.png](https://community.atlassian.com/t5/image/serverpage/image-id/234379i59C609E01C2D5210/image-dimensions/389x576?v=v2 "2023-01-13_12h43_30.png")


author: Dimitri P.
body: [@Anmol Jain](/t5/user/viewprofilepage/user-id/3670987) and Team,

**I am still not able to add the remote of GHE under ST.**
> I am injecting this under remote : https://MYTOKENINPLAINTEXT@github.com/MYCLIENT.git
>
> Same thing when I try to add an account - wrong URL or user not recognized

Note - I activated the SSO on the Token on the GHE side of things.
> Message : Userm / Email was not found

**Thanks** \^\^

comments: author: Dimitri P.
body: Anyone any idea please?


author: Dimitri P.
body: [@Ana Retamal](/t5/user/viewprofilepage/user-id/1067288) any idea please?


author: Dimitri P.
body: I think I found a solution by inserting a Source Tree SSH key in Github, then activating SSO on it under GHE, and finally simply cloning repos in SSH under ST. Let me know if this works for you folks? \^\^


author: Ivan Golovic
body: I am encountering same problem as the OP described on a clean installation of Windows 10 and Source Tree (in May 2020. so obviously nothing was fixed :/ ). I was able to clone the remote repository but I am not able to push to it, described situation happens.


Tags: account

atl-gruland

connect

enterprise

github

identity

issue

remote

sourcetree-enterprise

ssh