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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,295
Community Members
 
Community Events
184
Community Groups

Sourcetree Crashes when Cloning a Repository

Edited

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

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

Miro,

Thank you so much! That fixed my problem.

-Jason

Like danchiraico likes this

Thank you , fixed my problem.

Like danchiraico likes this

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

Niubi 👍

Like danchiraico likes this

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

Like # people like this

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

Like # people like this

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

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

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.

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.

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

Like # people like this

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

Like # people like this

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

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.

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

Like # people like this

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

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

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!

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.

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

Like # people like this

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

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?

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

Like 김상수 likes this

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  :)

Still happens in version 3.4.7.

Like # people like this

Committing a file doesn't solve the problem in 3.4.9

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

cloning repo from remote URL  (amazon)

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

Like selecters75 likes this

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 ?

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

Hi,

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

I am using 3.4.9 and still have the issue.

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.

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.

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

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

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

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

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.

Thx, this help me to resolve.

This also worked for me

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