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

Sourcetree Crashes when Cloning a Repository

Jason Harrington July 14, 2021

I have been using Sourcetree with two Gitlab repositories for several months without any issues. Recently, I wanted to add a third repository and every time I try to clone the new repository to Sourcetree, it crashes (Sourcetree locks up and I have to use the Task Manager to close it) When I paste the HTTPS address from GitLab, Sourcetree recognizes the repository as a Git repository. A status circle starts spinning next to Advanced options and then Sourcetree freezes up.

The version of Sourcetree that I have installed is 3.4.5. Within the windows event viewer, I have noticed two errors that pop up. My colleague has been able to close the repository on his computer using Sourcetree without any issues. Do you have any ideas why this is happening?

Thanks,

Jason Harrington

12 answers

1 accepted

23 votes
Answer accepted
Miro XY July 15, 2021

Hi, 

I had the same error.

I solved it as follows:

- uninstall version 3.4.5

- delete folder c:\Users\USERNAME\AppData\Local\Atlassian

- instal version 3.4.4 https://product-downloads.atlassian.com/software/sourcetree/windows/ga/SourceTreeSetup-3.4.4.exe

 

Miro

Jason Harrington July 16, 2021

Miro,

Thank you so much! That fixed my problem.

-Jason

Like danchiraico likes this
Pavariss Lintha October 29, 2021

Thank you , fixed my problem.

Like danchiraico likes this
Wojtek Tomalik November 7, 2021

if you don't want to revert to an older version of the software, see Aidan's answer below - making sure the repo is not empty worked for me as well.

Like # people like this
Jay Ben December 26, 2021

Niubi 👍

Like danchiraico likes this
a2cworks February 6, 2022

Still happens in version 3.4.7. 😥
The bug is not fixed yet.  (´・ω・`)

Like # people like this
Sagar Srivastava February 12, 2022

I confirm. its still crashing at this step in 3.4.7 and 3.4.4 works

Like # people like this
MOHAMOD Shah February 24, 2022

Having the same issue with version 3.4.7. Found the following error information in Windows Event Viewer:

Application: SourceTree.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IndexOutOfRangeException
at SourceTree.Repo.RepoHandlerGitOld.GetDefaultBranch(System.String)
at SourceTree.ViewModel.CloneNewDialogViewModel+<>c__DisplayClass212_0.<RefreshRemoteBranches>b__1()
at System.Threading.Tasks.Task`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetResult()
at SourceTree.ViewModel.CloneNewDialogViewModel+<RefreshRemoteBranches>d__212.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at SourceTree.ViewModel.CloneNewDialogViewModel+<CheckSource>d__211.MoveNext()

Exception Info: ReactiveUI.UnhandledErrorException
at ReactiveUI.RxApp+<>c__DisplayClass11_0.<.cctor>b__2()
at System.Reactive.Concurrency.Scheduler.Invoke(System.Reactive.Concurrency.IScheduler, System.Action)
at System.Reactive.Concurrency.DispatcherScheduler+<>c__DisplayClass12_0`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<Schedule>b__0()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at SourceTree.App.Main()

Like # people like this
MOHAMOD Shah March 3, 2022

For time being, I have installed version 3.4.4 and it's working fine. Thank you @Miro XY for the download link.

Katrina Stading March 22, 2022

Installing 3.4.4 worked for me. In all instances where Sourcetree was crashing for me, the repository already contained several files. So Sourcetree isn't just crashing if you try to clone an empty repo.

19 votes
Aidan August 4, 2021

I encountered this exact same error just recently as well. I found that all I needed to do was actually commit something to the repository (e.g. a readme to the master branch) in order for Sourcetree not to crash when trying to clone. Initially the repository was brand new and empty, which I guess Sourcetree chokes on.

Jason Harrington August 11, 2021

Thanks for your response Aidan. If I encounter this again, I will give it a try.

Like # people like this
Atanas Harapov August 28, 2021

Can confirm when opening a new repository without commits it crashes on version 3.4.6.

Like # people like this
G Salas September 3, 2021

Also confirmed that trying to clone an empty repository does crash 3.4.5 and 3.4.6.

Thanks for posting this solution!

Like # people like this
SETS_Insperion October 29, 2021

Hi, good day. I confirmed as said by Atanas Harapov, version 3.4.6 is still crashed when I tried to clone a repo w/o any branches & commits.

David John Brown November 16, 2021

I'm a confused newbie. How can I commit to an empty repository when I am unable to clone it?

Like # people like this
Mark Jeffery November 16, 2021

Good question, David John Brown.

There are a couple of ways of doing this.

If you created your repository in BitBucket, you can access it by signing in at https://bitbucket.org, find your repository, and create a file in it, for example, use the option to create a default .gitignore file. That one file is enough to get around this bug.

Otherwise, you might have to SSH into your server and use command-line git to commit a file, which is really not easy for a newbie. Which is ironic: the whole point of Sourcetree is to avoid the need to use command-line git!

Hope that helps. And I've no idea how to get the attention of the Atlassian team, but please, for pity's sake, if you're reading this: this silly issue is a huge impediment to people's getting going on Sourcetree. Please, please do the simple fix and stop confusing newbies!

Like # people like this
David John Brown November 16, 2021

Thank you, Mark Jeffery. I got round it (after some head scratching) by using Git GUI, which I would prefer to have avoided given that I was following a Sourcetree tutorial!

Like Mark Jeffery likes this
SETS_Insperion November 16, 2021

Greetings David, as said by Mark Jeffery, when you create an empty repository BitBucket suggests making an "Initial Commit" with a README.md and/or with .gitignore file, both of them are in buttons in the repo creation form OR in the instructions when you finish the creation of. This is the common workaround I've found in this community. Regards and have a good day!

David John Brown November 18, 2021

Thank you, SETS_Insperion. I fell into this trap as I was trying to follow step-by-step a very good tutorial which I was using to try to get to grips with Sourcetree. I hated having to break off from the tutorial to workaround the issue. However I'm back on track now, thanks to the internet and, in particular, to this post.

Jonathan Boivin January 12, 2022

Same issue using version 3.4.7. Fixed it creating an empty file on the remote repository.

Like # people like this
R4DIC4L February 17, 2022

Fixed it by creating a README file in the Gitlab repo. Thanks, Aidan!

Michael Lant March 21, 2022

Same problem here using 3.4.8.

Solved by cloning a brand new repo using Visual Studio, copying a file (any file) into the new location on-disk. I could then, successfully open SourceTree on the local copy and Commit/Push.

This has been an open issue since July 2021 - eight months. This should be something very easy to fix. What's up?

harishismyname September 5, 2022

Committing a readme file still doesn't work in 3.4.9. Still crashing on clone.

Like 김상수 likes this
5 votes
Mark Jeffery November 4, 2021

As suggested by Aiden:

  • No need to downgrade to a previous version
  • Just commit a file (any file) to your repository and Sourcetree will no longer crash on cloning

Hey, Atlassian folk, could we get a fix for this? It's a strong candidate for a really easy fix:

  • well-defined: just clone a repository with no files in it
  • reproducible: happens every time!
  • recently introduced: it didn't happen in 3.4.4, it does happen in 3.4.5...latest (3.4.6)

Just crashing imposes real costs on users (we have to search the web for a solution, downgrade to an older version and/or work around the issue)... and crashing is not a good look!

Thanks  :)

Tobias Knauss December 20, 2021

Still happens in version 3.4.7.

Like # people like this
harishismyname September 5, 2022

Committing a file doesn't solve the problem in 3.4.9

1 vote
alex zeleksonov September 21, 2022

Hi,
still happing in 2022, version 3.4.9 it pretty sucks, could fix this

cloning repo from remote URL  (amazon)

harishismyname September 21, 2022

Exact remote and version for me too. Still have the problem.

Like selecters75 likes this
0 votes
Tommy Hamel March 2, 2023

Anyone got a solution on this i got a user he got the exactly same think and i do all the answer i see on the website and nothing work. I can do the cloning with the terminal but i cannot do it directly in Sourcetree. My version is the latest one 3.4.11 and I got Windows 11 at the latest version too. I really don't know why i cannot clone with Sourcetree can anyone help me please ?

Stefan Jonsson March 2, 2023

Use the old version 3.4.4 as mentioned, that should work.

Like alex zeleksonov likes this
0 votes
Silvia Ramos August 25, 2022

Hi,

I had the same issue with version 3.4.7. Upgrading to the latest one (3.4.9) solved the problem.

harishismyname September 5, 2022

I am using 3.4.9 and still have the issue.

0 votes
krembo99 April 19, 2022

This crash bug is still alive @Ver.3.4.8 when using other servers ( Gitlab / Gogs / Gitea ) - exactly as OP described - even with non-empty repos.

0 votes
Stefan Jonsson February 3, 2022

Got the same problem with Sourcetree 3.4.7, did the actions that Miro XY  suggested.

Deleted the folder and use version 3.4.4.

Tommy Hamel March 3, 2023

I use the 3.4.4 and the first clone working but if i restart the computer Sourcetree never open again after.

0 votes
Tobias Arendt January 14, 2022

Hi, still the same problem in 3.4.7. It's starting to get embarrassing!

0 votes
Oleg Maslennikov December 27, 2021

Hi everybody, i had faced with same problem and i found there is a error when you make a git clone via console : 

Cloning into 'src'...
warning: You appear to have cloned an empty repository.

 

So please check your repo on empty and if it's empty just add readme throw  web ui

harishismyname September 5, 2022

Adding a file doesn't seem to solve it on 3.4.9

0 votes
Michael Reiff November 18, 2021

This is my Solution (as a git-Rookie):

  1. Create Repository in Bitbucket
  2. Open Sourctree
  3. In Sourctree: click on Terminal (right, top line)
  4. In the Terminal: use the commands cd, cd.. and dir (with TAB) to navigate to an empty Directory
  5. In the Bitbucket-Repository: copy the clone-command: "git clone https://............./test-repo-02.git
  6. Terminal: paste the command and press Enter
  7. Windows-Explorer: go to the Directory and add e.g. a Text-File
  8. Sourctree: Add a new Tab and Add the Directory
  9. You are ready to commit and push the Repository

Hope this helps someone.

ivan80057891 January 31, 2022

Thx, this help me to resolve.

selecters75 October 13, 2022

This also worked for me

0 votes
Tomás October 4, 2021

Hi,

I'm having the same error in version 3.4.6.

I try to clone a repository, paste the URL, checks if it is a Git repository and them crashes the application.

I'm returning to version 3.4.4 as suggested by Miro XY in one of the answers in this thread.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events