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

3 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?

0 vote

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.

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.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 11, 2018 in Sourcetree

Tip from the team: debugging Sourcetree

Supported Platforms macOS Windows If you're reading this and it's not just educational… we know you're unhappy right now and apologize for that   We're dedicated to improving yo...

706 views 10 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you