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

How to install SourceTree through proxy

Lassi Autio
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 19, 2017

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

9 answers

5 votes
Peter Wake
Contributor
January 15, 2018

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
}
]

 

Christian Mötzing
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 22, 2018

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

Tim Cornwell April 3, 2018

Works as advertised.  Thanks!

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

Like # people like this
Patrick Keenan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 17, 2018

You sir are a bleeping godsend.

Tim Cornwell April 19, 2018

Well done!  Also:

 

HELLO ATLASSIAN!!!

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

john visher
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 8, 2018

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

Marian Brostean
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 26, 2018

Great solution!!! Bravo!!!

jeroenp
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 28, 2018

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
2 votes
daniel-gredler-dhl
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 15, 2019

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.

Dave Thomas
Contributor
April 8, 2020

Same for us.   We're a BitBucket data center customer and we have the same issues.   When SourceTree was developed by an independent company, it would just install with no problems.   Any networking issues could be handled in the settings afterwards.   With Atlassian's ownership, they've inserted this login registration step that frequently just doesn't work.  If the user can log into our BitBucket server using their browser, but can't get the SourceTree installation to accept the exact same URL and login credentials, what am I supposed to tell the user?   Exactly:   use something else.  That's what I'm telling all of our users now.

1 vote
Bob Beauchaine
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 31, 2019

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.

0 votes
Millis Jonny
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 26, 2021

Thank you very much for the detailed guide that was described above. But unfortunately, I have other problems now. When I go to different sites, they block me as soon as I try to log in there. I have already tried all the free proxies that were possible. I also think about how I can get rid of the reduced Internet traffic. Maybe the point is that I should try using a paid proxy server? I just watched different guides on YouTube on how to fix various problems with the network. I came across the site proxies.com , where you can buy high-quality proxy servers. Here I think, whether it is worth trying.

0 votes
user
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2020

https://github.com/yike8/sourcetree-skip-bitbucket-registration worked for me with SourceTree 3.3.6.  Spent over an hour trying several old methods to no avail.  Ugh.

Anh Duong
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 2, 2020

Work for me, thanks!

0 votes
rmjcsltd
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 7, 2020

It's 2020 now and I've just wasted half a day trying to install Sourcetree. Time to find a new Git GUI.

john visher
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 7, 2020

Please make this easier. I've installed but other competent programers have wanted to install and use it but are unable to.

0 votes
Prakash Rai June 6, 2019

,

0 votes
Peter Wake
Contributor
January 14, 2018

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.

Prakash Rai June 6, 2019

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

Like Eduard Tudoras likes this
0 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 20, 2017

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

Lassi Autio
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 21, 2017

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.

Peter Wake
Contributor
January 14, 2018

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.

Like Matt Potosnak likes this
Peter Wake
Contributor
January 15, 2018

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 Brough -Adaptavist-
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 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"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events