34

I'm trying to use SourceTree for a class that I'm teaching. In order to do that we need to install SourceTree onto the school's Windows computers.

When we try to install SourceTree (Version 1.9.10.0) it demands an Atlassian account before it will start. Obviously this is wrong - since we're trying to install SourceTree onto a shared computer (into a VM, to be specific) we don't have just one account (and, on top of that, we're using SourceTree with GitLab, not BitBucket/Atlassian, so we don't need their account anyways).

Is it possible to install SourceTree but skip the 'create an Atlassian account' step during the install process?

(We'd be ok with having the students create accounts later on, when they first start using it - we just don't want all the students to share a single BitBucket account by default)

MikeTheTall
  • 3,214
  • 4
  • 31
  • 40
  • SourceTree requires an account but not payment -- REMEMBER, when you make edits it uses your user -- so GIT on a shared computer does not makes sense unless it is the master node and then you don't need UI (and should specifically not have it or a working area) – Hogan Dec 29 '16 at 20:41
  • 1
    I'm looking for a GUI client for each, individual student to use in order to access a GitLab server that I've set up. There's only 1 VM image, and when a student logs into the VM server they can then make their own, unique changes to their instance (I'm pretty sure the instances are deleted on logout). The main thing is that each student should set up the client to connect to their individual/specific repos on the server - I don't want to have all the VM images defaulting to an account I created in order to install ST :) – MikeTheTall Dec 29 '16 at 23:41
  • No installation and no registration https://stackoverflow.com/a/61740168/696535 – Pawel May 11 '20 at 22:36

10 Answers10

20

Updated 2020-11-27

Happy to see that SourceTree allow users to skip the login procedure in version 3.3.9.

For older versions:
SouceTree uses accounts.json file to store account settings.
It would skip the login process if there is an accounts.json file in your machine.
So you can copy the accounts.json file in %AppData%\Atlassian\SourceTree\ to any other machine to skip the login procedure.

ws_
  • 1,076
  • 9
  • 18
9

I don't think SourceTree allows to install without using an Atlassian Account. I've also tried and couldn't make it.

Have a look at Github Desktop, I think it allows not to configure an account https://desktop.github.com/

(I also prefer the UI from what I've seen - CLI still rules)

Edit: keep in mind that's easier for the students to google by themselves solutions to problems with git using the CLI than using UI apps

pedrorijo91
  • 7,635
  • 9
  • 44
  • 82
  • 1
    UI wise they are about the same -- ST has some extra features and was more stable -- but that could have changed. – Hogan Dec 29 '16 at 20:47
  • probably they won't need those extra features if it's a beginners class. but I'm curious, which features? – pedrorijo91 Dec 29 '16 at 20:48
  • dang it was a year ago when I researched it... calling me out. Let me look. – Hogan Dec 29 '16 at 20:49
  • 1
    There is a lot actually -- GHD just supports checking in and branching and viewing in the UI -- they expect you to use the web for most stuff. Sourcetree has support for GIT and Hg -- runs on windows and unix -- than then supports (to some extent) all functionality in the UI -- merging, rebasing, branching, creating tags, etc etc. The winner for me was a team member that used unix. – Hogan Dec 29 '16 at 20:53
  • 7
    The answer to "how do I install X?" should only be "don't, use Y instead" if installing X is not possible or a very bad idea, and if that is the case, that should be explained in the answer. As it is, this doesn't attempt to answer the question and shouldn't have been posted in its current form. –  Dec 29 '16 at 20:57
  • true. it was somehow implicit, but made it explicit @hvd – pedrorijo91 Dec 29 '16 at 21:00
  • I got the impression that this was true - thank you for the confirmation! – MikeTheTall Dec 29 '16 at 23:42
  • I've thought about having them use a CLI but that just adds another hurdle to overcome. We're just going to start out with 'fork to your own repo, pull, change/commit, push', and then I'll use a Python script to download everyone's homeworks. That can be done well enough in a GUI, and the students don't (yet) need to learn all the CLI stuff. That'll be for another day. – MikeTheTall Dec 29 '16 at 23:45
  • 2
    For Mac, if anybody interested its version 2.3, the one with DMG – M.Yessir Jul 30 '18 at 14:59
  • I advice to install Fork instead of GitHub Desktop because Fork is more flexible and better resembles SourceTree. – Finesse Oct 25 '18 at 14:22
  • GitHub Desktop not support 32 bit OS :-( – Gil Epshtain Jan 24 '19 at 10:43
7

Thanks to Mike for mentioning the version of SourceTree that did not require a login.

It's possible to install SourceTree v1.6.4 which does not require a login to an Atlassian acount.

How to install SourceTree v1.6.4 for Windows

How to install SourceTree v1.6.4 for Windows

This gist shows how to install SourceTree without having to login to an Atlassian account.

Later versions of SourceTree after v1.6.4 require a login to an Atlassian account.

Steps:

  • Install Chocolatey
  • Install SourceTree 1.6.4 using Chocolatey

Install Chocolatey

  • Run Windows Powershell as Administrator
  • Run the following command Set-ExecutionPolicy Bypass; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Install SourceTree Using Chocolatey

Run the following command within an administrative console/terminal/powershell.

choco install sourcetree --version 1.6.4

References

stormwild
  • 2,855
  • 2
  • 31
  • 38
4

Can confirm that SourceTree V 1.6.14.0 does NOT require an account... so this is why I hit never update for an old version on my other computer ;)

I am not 100% sure if that is the latest version that still has this feature, but works for my purposes.

Mike
  • 83
  • 7
4

https://github.com/yike8/sourcetree-skip-bitbucket-registration

How to skip bitbucket registration when installing sourcetree?

The first step is to run SourceTreeSetup-3.1.3.exe and close it after popping up the registration interface.

The second step is to open the %LocalAppData%\Atlassian directory, find accounts.json and user.config, and replace them with the files I provided.

e.g.

%LocalAppData%\Atlassian\SourceTree\accounts.json

%LocalAppData%\Atlassian\SourceTree.exe_Url_iayhtc13zv3obzuz5vchezjs1az2q5ef\3.1.3.3158\user.config

yike8
  • 41
  • 1
2

I just discovered you need an account to access the app, but you can logout and still be able to use the app.

Michael Ozeryansky
  • 7,204
  • 4
  • 49
  • 61
2

You can create a temp account by using a temp email. Then you can delete the account once its installed and use your own corporation git ids. It is the easiest way.

1

I managed to avoid registration with the current version as of today, which is 3.3.8.

All you need is yet an already mentioned 'accounts.json' placed in %AppData%\Atlassian\SourceTree\accounts.json (look carefully, it's now %Appdata% not %Local...%)

The file I used prepares a GitHub account with OAuth (you will need to apply some fresh OAuth from the edit accounts dialog). You can also delete that account and do what you like.

[
  {
    "$id": "41",
    "$type": "SourceTree.Model.ScmAccount, SourceTree.Api.Host.Scm",
    "IsDefault": false,
    "Authenticate": true,
    "HostInstance": {
      "$id": "42",
      "$type": "SourceTree.Host.GitHub.GitHubInstance, SourceTree.Host.GitHub",
      "Host": {
        "$id": "43",
        "$type": "SourceTree.Host.GitHub.GitHubHost, SourceTree.Host.GitHub",
        "Id": "github"
      },
      "BaseUrl": "https://github.com/",
      "Protocol": "HTTPS"
    },
    "Credentials": {
      "$id": "44",
      "$type": "SourceTree.Api.Account.OAuth.TwoZero.OAuthTwoZeroCredentials, SourceTree.Api.Account.OAuth.TwoZero",
      "AuthenticationScheme": {
        "$type": "SourceTree.Api.Account.OAuth.TwoZero.OAuthTwoZeroBearerAuthenticationScheme, SourceTree.Api.Account.OAuth.TwoZero",
        "Name": "OAuth",
        "Description": "OAuth Token",
        "HeaderValuePrefix": "Bearer",
        "UsernameIsRequired": false
      },
      "Id": null,
      "Username": "github-username",
      "DisplayName": "Your Name",
      "Email": null,
      "AvatarURL": "https://cdn3.iconfinder.com/data/icons/inficons/128/stackoverflow.png",
      "EmailHash": null
    }
  },
  {
    "$id": "18",
    "$type": "SourceTree.Api.Host.Identity.Model.IdentityAccount, SourceTree.Api.Host.Identity",
    "IsDefault": false,
    "Authenticate": true,
    "HostInstance": {
      "$ref": "42"
    },
    "Credentials": {
      "$ref": "44"
    }
  }
]
tobster
  • 155
  • 1
  • 8
1

2020 update No admin, no installation, no registration

Here's a script that downloads version 3.3.8, unpacks MSI and copies config files to %APPDATA% to skip registration

https://github.com/DVLP/sourcetree-portable-bypass-registration

Download as ZIP, in powershell run sourcetree_portable.ps1

$version="3.3.8"
$url="https://product-downloads.atlassian.com/software/sourcetree/windows/ga/SourcetreeEnterpriseSetup_$($version).msi"
$client = New-Object System.Net.WebClient

echo "Downloading sourcetree"
$client.DownloadFile($url, (Get-Item -Path ".\").FullName + "\sourcetree.msi")
mkdir sourcetree
$msi = (Get-ChildItem "*.msi" | select  -Last 1).fullname
$target = (Get-Item -Path ".\sourcetree").FullName

echo ""
echo "Unpacking..."
msiexec /a $msi /qb TARGETDIR=$target
Start-Sleep -s 5

echo "Opening and closing SourceTree.exe to create default directories..."
$exe = (Get-ChildItem -Recurse "./SourceTree.exe" | select  -Last 1).fullname
& $exe
Start-Sleep -s 5
echo "Waiting 10s. Don't close SourceTree, it will close itself."
Start-Sleep -s 10

echo "Killing SourceTree"
kill (Get-Process SourceTree).id

echo "Finding installation directories"

$userConfPath=(Get-ChildItem -LiteralPath $env:LOCALAPPDATA\Atlassian -Recurse -Directory -Filter $version* -Force).fullname

echo "Copying config files (sign-in bypass)"
Copy-Item ".\user.config" -Destination $userConfPath
Copy-Item ".\accounts.json" -Destination $env:APPDATA\Atlassian\SourceTree

echo "Flattening folder"
Get-ChildItem -Path .\sourcetree\ProgramFiles\Atlassian\Sourcetree -Recurse | Move-Item -Destination .\sourcetree
# Start-Sleep -s 2

echo "Cleaning up"
rm $msi
rm .\sourcetree\sourcetree.msi
rm -Recurse .\sourcetree\ProgramFiles

Read-Host -Prompt "Press Enter to exit"
Pawel
  • 16,093
  • 5
  • 70
  • 73
1

I just noticed that you can skip the registration in the current version 3.3.9 with a new button. But this seems not to be documented.

https://product-downloads.atlassian.com/software/sourcetree/windows/ga/ReleaseNotes_3.3.9.html

Update 17.09.20: I took screenshots from the versions 3.3.8 and 3.3.9 to show the differences. I wasn't able to run the installer in English so I can only provide this German version. ("Überspringen" means "to skip")

Installation of version 3.3.8

Installation of version 3.3.9

Muntasir
  • 798
  • 1
  • 14
  • 24
Bekko
  • 21
  • 4