Updating SourceTree and Git Bash

I recently updated my SourceTree application and found that I could no longer use the Git Bash terminal.

This error appeared when I clicked on the Terminal button at the top right corner of the application

It has not been possible to start the Git Bash terminal”. 

This isn’t the most informative error message that I’ve ever seen.  I typed the error message into Google to see if I could get a better description of the issues that would cause SourceTree to behave in this manner.   Most of the advice centres on upgrading Git Bash to v2.6.3 or rolling back to previous version of SourceTree.  There are a couple of tickets raised for this issue on the public SourceTree Atlassian Jira however the ones that I have seen are either duplicates, which have been closed and refer to tickets that I need to log in to see or they are slight variations of the issue.  So I thought I’d document what I did and see if it will help someone out.

Steps:

  1. Download version 2.6.3 of Git.  You can either go to https://git-scm.com/ or I’ve started to use https://chocolatey.org/ to install new software on my machines.  You need to install chocolatey first (the instructions are on the main page) and then run whatever command line application that you use.  Type something like “choco install git”, this will go away and download the chocolatey package and then silently install the application.
  2. If you haven’t set up chocolatey then double click on the downloaded application.  This will run the setup for Git.  You can set this up the way that you like it but I went with the defaults (aside from selecting the options to create shortcut on the desktop and adding Git Bash to the right click menu).

Note: I experienced several issues relating to the installation, which might be only on my local machine but worth documenting none the less.

Issues:

  1. At the end of the install, it would hang and never complete.  I had to end the task using task manager and then delete the directory that it had installed into.  Then restart the installation.
  2. Occasionally on some attempts at the install, it would try to uninstall the last version.  It would end in failure because it could not find the unins000 files and give you no choice to abort.  The files were in the installation folder however, I could not reference them.  On this occasion, I used Revo Uninstaller to get rid of all references.
  3. If I didn’t get rid of all references to the folder where it was installing to, it would fling random errors relating to files not being found to it could not create directory tmp.

The safe thing to do is to clear the directory out.  I’ve also got it installed on the root of my C: drive.

Now with Git install, we are onto starting Git Bash independently of SourceTree.  When I first started bash.exe, it was just disappearing.  When I started the the bash.exe in a command prompt, I could see that it was giving the error message “Access is denied”.  This was because my firewall Comodo was blocking the executable from running.  I had to add bash.exe to the list of allowed applications for Defense+ within the HIPS section.  To do this I went to Comodo (it is on Advanced View).  You can select this option by right-clicking on the Comodo tray icon and selecting “Advanced View”. 

Steps:

  • Open Comodo
  • Click on HIPS
  • Settings should open up
  • Select HIPS Rules
  • Click on upwards arrow at the bottom of the screen.
  • Click Add
  • Browse for the application (in my case, C:\Git\bin\bash.exe)
  • Use ruleset of allowed application
  • Click OK.

You might need have to add mintty.exe (https://code.google.com/p/mintty/) in the Git\user\bin as well but it is same process as above.  The Git Bash should now start as the firewall is no longer treating the application as a blocked intrusion. 

The last thing to do, is to open up SourceTree and click on terminal.  Git Bash should now open. Also, go to Tools –Options – Git.  If you use system git the version should now be 2.6.3.

In conclusion, this is task that shouldn’t take that long but can be frustrating if you hit small errors.  I hope if you are hitting these errors then this post will help.  As ever if there are better ways of doing anything described here I would like to hear it.