It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to install SourceTree through proxy

I should intall SourceTree to server that has connection to Internet only through proxy. What should I do to install it through proxy?

 

I found exacty same question but it doesn't have an unswer:

https://community.atlassian.com/t5/Sourcetree-questions/How-to-install-Source-Tree-in-a-server-with-Proxy/qaq-p/630734

6 answers

I first saw this solution on another site, but posting the link seemed to get my post silently removed, so I've left it out this time. I can't take credit for coming up with this answer, though I have rewritten it, hopefully to make it simpler and clearer. 

Step-by-step guide

  • Make an Atlassian account if you don't have one.
  • Download latest installer.
  • Run the installer. Progress through the steps.
  • When it gets to the Atlassian login popup, quit out of the installer.
  • Go to your %APPDATA%\..\Local\Atlassian\SourceTree directory.
  • Create an empty text file called passwd.txt
  • Create a file called accounts.json
  • Paste the text below into the .json file.
  • Replace the words 'YOUR EMAIL HERE' with the email you used for the Atlassian account.
  • Save your updated json file.
  • Re-run the installer.
  • Magic happens!

What should happen, is that the installer lets you skip the login step, and a working SourceTree window opens

JSON file contents:

[
{
"$id": "1",
"$type": "SourceTree.Api.Host.Identity.Model.IdentityAccount, SourceTree.Api.Host.Identity",

"Authenticate": true,
"HostInstance": {
"$id": "2",
"$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountInstance, SourceTree.Host.AtlassianAccount",
"Host": {
"$id": "3",
"$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountHost, SourceTree.Host.AtlassianAccount",
"Id": "atlassian account"
},
"BaseUrl": "https://id.atlassian.com/"
},
"Credentials": {
"$id": "4",
"$type": "SourceTree.Model.BasicAuthCredentials, SourceTree.Api.Account",
"Username": "YOUR EMAIL HERE"
},
"IsDefault": false
}
]

 

Worst installation user experience ever. Thank you for your guide though.

Works as advertised.  Thanks!

(Also: exposes what the accounts.json file looks like for future reference)

You sir are a bleeping godsend.

Well done!  Also:

 

HELLO ATLASSIAN!!!

Why-oh-why do we have to do this?

Thanks Peter. This worked for me also. Is everyone dead at Atlassian?

Great solution!!! Bravo!!!

This fails to work as of SourceTree 3.

This works:

  1. Run Process Explorer on the target system
  2. Run the SourceTreeSetup installer on the target system
  3. When registering, click on the "BitBucket" button on the target system
  4. In Process Explorer, find out the web browser process that the setup kicks off and grab the command-line, which looks like this when running Chrome as default browser:
    "%LocalAppData%\Google\Chrome\Application\chrome.exe" -- "https://bitbucket.org/site/oauth2/authorize?response_type=code&client_id=123456789012345678&state=authenticated&redirect_uri=http://localhost:34106/"
  5. Copy the URL bit https://bitbucket.org/site/oauth2/authorize?response_type=code&client_id=123456789012345678&state=authenticated&redirect_uri=http://localhost:34106/ over and paste it on a machine that has internet access
  6. Logon, and follow the steps until the URL look like this: http://localhost:34106/?state=authenticated&code=876543210987654321
  7. Copy that URL over to a web-browser on the target system and execute it
  8. Finish the installation steps on the target system
Like Kawakami Akari likes this

This is the straw that broke the camel's back for me. I like SourceTree, but the requirement to have a BitBucket account is barely acceptable, and then to have obscure proxy / login issues crop up because of this unnecessary BitBucket marketing ploy is unacceptable. I'm moving on to something else.

0 votes

Hi Lassi,

I found a Communities discussion that may help titled Solved: using proxies with SourceTree.  The guidance is this needs to be set in the configuration for git/mercurial, etc:

Because proxy handling is different for each of Mercurial and Git, this needs to be configured in their respective config files; this isn't currently homogenised in the SourceTree preferences.

Another user mentioned using an authenticated proxy:

...if your proxy requires authentication (get a HTTP 407 error) you will need to put username and password in your proxy string.

I then sometimes get an SSL error which can be remediated by following the solutions mentioned here: SSL certificate rejected trying to access GitHub over HTTPS behind firewall

Cheers,

Branden

Unfortunately this didn't work :(

I am installing SourceTree. How is installing using .gitconfig? Especially when it is trying to connect to Internet when asking for Atlassian account.

Exactly! The answers above, and the communities answer aren't pertinent to the actual question - they address how to use git, and set git configuration - that it is SourceTree calling git is incidental, it's all a git issue.

The actual question is about how to install SourceTree. You cannot install it behind a strict proxy, because you must log in to Atlassian, and you cannot log in because the proxy is blocking that.

Configuring your git proxy won't help you there. I know because I have SourceTree 1.7 working through a proxy. I have git working through a proxy, but I still cannot install SourceTree 2.4.7.0, due to the requirement to log in to Atlassian (nor could I install 1.8 for that matter).

What I need to know is how to configure the proxy for the installer. Not for git.

I posted an actual answer to this problem. But is was silently removed. I'll try posting it again, without the link, or mention of the site name, and see if it survives.

nic Community Leader Jan 15, 2018

Yes, I think the spam filter got it, it often does with links.  I'm not sure I disagree - a lot of work I get has been generated by "I did this thing I found on stack overflow and now my Atlassian stuff is broken"

I found the answer to this on StackOverflow, question 36467893: here

But this is what it amounts to...

Step-by-step guide

  • Make an Atlassian account at https://id.atlassian.com
  • Download latest installer from https://www.sourcetreeapp.com/.
  • Run the installer. Progress through the steps.
  • When it gets to the Atlassian login popup, quit out of the installer.
  • Go to your %APPDATA%\..\Local\Atlassian\SourceTree directory.
  • Create an empty text file called passwd.txt
  • Create a file called accounts.json
  • Paste the following into the .json file:

Contents of accounts.json

[
{
"$id": "1",
"$type": "SourceTree.Api.Host.Identity.Model.IdentityAccount, SourceTree.Api.Host.Identity", "Authenticate": true,
"HostInstance": {
"$id": "2",
"$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountInstance, SourceTree.Host.AtlassianAccount",
"Host": {
"$id": "3",
"$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountHost, SourceTree.Host.AtlassianAccount",
"Id": "atlassian account"
},
"BaseUrl": "https://id.atlassian.com/"
},
"Credentials": {
"$id": "4",
"$type": "SourceTree.Model.BasicAuthCredentials, SourceTree.Api.Account",
"Username": "YOUR EMAIL HERE"
},
"IsDefault": false
}
]
  • Replace the words 'YOUR EMAIL HERE' with the email you used for the Atlassian account.
  • Save your updated json file.
  • Re-run the installer.
  • Magic happens!

What should happen, is that the installer lets you skip the login step, and a working SourceTree window opens.

Did not work for me . I am installing sourcetree 3.1.3.

0 votes

Ok, SourceTree is now dead to me since it cannot install in what is a common enterprise situation.  I'll stick with TortoiseGit for the time being as it actually installs and doesn't require an account with a repository service I don't intend to use.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

675 views 0 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you