我试图将SourceTree用于我正在教授的课程。为此,我们需要将SourceTree安装到学校的Windows计算机上。
当我们尝试安装SourceTree(版本1.9.10.0)时,它需要一个Atlassian帐户才能启动。显然这是错误的 - 因为我们尝试将SourceTree安装到共享计算机上(特定于VM),我们不会只有一个帐户(而且,除此之外,我们还有#39;使用SourceTree和GitLab,而不是BitBucket / Atlassian,所以我们不需要他们的帐户。
是否可以安装SourceTree但跳过“创建Atlassian帐户'安装过程中的步骤?
(我们可以让学生稍后创建帐户,当他们第一次开始使用帐户时 - 我们不希望所有学生默认共享一个BitBucket帐户)
答案 0 :(得分:8)
是的,这很有可能。
%LocalAppData%\Atlassian\SourceTree\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": "",
"Email": null
},
"IsDefault": false
}
已更新,适用于3.1.2版本
[
{
"$id": "19",
"$type": "SourceTree.Api.Host.Identity.Model.IdentityAccount, SourceTree.Api.Host.Identity",
"IsDefault": false,
"Authenticate": true,
"HostInstance": {
"$id": "20",
"$type": "SourceTree.Host.Bitbucket.BitbucketInstance, SourceTree.Host.Bitbucket",
"Host": {
"$id": "21",
"$type": "SourceTree.Host.Bitbucket.BitbucketHost, SourceTree.Host.Bitbucket",
"Id": "bitbucket"
},
"BaseUrl": "https://bitbucket.org/",
"Protocol": "HTTPS"
},
"Credentials": {
"$id": "22",
"$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",
"HeaderValuePrefix": "Bearer",
"UsernameIsRequired": false
},
"Id": "",
"Username": "",
"DisplayName": null,
"Email": "",
"AvatarURL": null,
"EmailHash": ""
}
}
]
答案 1 :(得分:7)
我不认为SourceTree允许在不使用Atlassian帐户的情况下安装。我也尝试过,但也做不到。
看一下Github Desktop,我认为它不允许配置帐户https://desktop.github.com/
(我也更喜欢我所看到的UI - CLI仍然是规则)
修改请注意,学生使用CLI自行解决使用git问题的解决方案比使用UI应用更容易
答案 2 :(得分:5)
感谢Mike提及不需要登录的SourceTree版本。
可以安装SourceTree v1.6.4,它不需要登录Atlassian帐户。
How to install SourceTree v1.6.4 for Windows
这个要点显示了如何安装SourceTree而无需登录Atlassian帐户。
v1.6.4之后的SourceTree的更高版本需要登录Atlassian帐户。
Set-ExecutionPolicy Bypass; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
在管理控制台/ terminal / powershell中运行以下命令。
choco install sourcetree --version 1.6.4
答案 3 :(得分:4)
可以确认SourceTree V 1.6.14.0不需要帐户......所以这就是我在其他计算机上点击永远不会更新旧版本的原因;)
我不是100%确定这是否仍然具有此功能的最新版本,但是可以用于我的目的。
答案 4 :(得分:2)
您可以使用临时电子邮件创建临时帐户。然后,您可以在安装帐户后删除该帐户,并使用自己的公司git ID。这是最简单的方法。
答案 5 :(得分:1)
我刚刚发现您需要一个帐户才能访问该应用程序,但是您可以注销并仍然可以使用该应用程序。
答案 6 :(得分:1)
我设法避免从当前版本3.3.8开始注册。
您所需要的只是放置在其中的已经提到的'accounts.json' %AppData%\ Atlassian \ SourceTree \ accounts.json(仔细看,现在是%Appdata%而不是%Local ...%)
我使用的文件使用OAuth准备了一个GitHub帐户(您需要从“编辑帐户”对话框中应用一些新的OAuth)。您也可以删除该帐户并执行自己喜欢的操作。
[
{
"$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"
}
}
]
答案 7 :(得分:1)
2020更新,无需管理员,无需安装,无需注册
这是一个脚本,可下载版本3.3.8,解压缩MSI并将配置文件复制到%APPDATA%以跳过注册
https://github.com/DVLP/sourcetree-portable-bypass-registration
以ZIP格式下载,在powershell中运行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"
答案 8 :(得分:1)
我刚刚注意到,您可以使用新按钮跳过当前版本3.3.9中的注册。 但这似乎没有记录。
https://product-downloads.atlassian.com/software/sourcetree/windows/ga/ReleaseNotes_3.3.9.html
更新17.09.20: 我从版本3.3.8和3.3.9截取屏幕截图以显示差异。 我无法用英语运行安装程序,因此我只能提供此德语版本。 (“Überspringen”的意思是“跳过”)
答案 9 :(得分:0)
https://github.com/yike8/sourcetree-skip-bitbucket-registration
在安装sourcetree时如何跳过位桶的注册?
第一步是运行SourceTreeSetup-3.1.3.exe,并在弹出注册界面后将其关闭。
第二步是打开%LocalAppData%\ Atlassian目录,找到accounts.json和user.config,并将它们替换为我提供的文件。
例如
%LocalAppData%\ Atlassian \ SourceTree \ accounts.json
%LocalAppData%\ Atlassian \ SourceTree.exe_Url_iayhtc13zv3obzuz5vchezjs1az2q5ef \ 3.1.3.3158 \ user.config
答案 10 :(得分:-1)
我刚刚发现了Elegit。 Elegit不需要帐户而且附加功能专门用于帮助人们真正理解git(而不是https://xkcd.com/1597/ :))