Friday, September 14, 2012

Git Extensions 240 on Ubuntu 12.04

While I do most of my git work from the command line, I occasionally use GitExtensions for viewing the history of commits and for it's visualization of which commits are in which branch. When converting to Ubuntu I was glad to find out that GitExtensions worked on Linux, but it was not as clear on how to set it up. Apparently, the Linux support for GitExtensions is not as good as the Windows support. GitExtensions is written in C# and utilizes mono to be able to run cross-platform.

I spent some time trying to figure out how to get this to run on Ubuntu. There is a youtube video about getting this to work in Ubuntu 11.04 but after following the steps shown, I still could not get it to work.

Here is what I ended up doing. I downloaded the .zip file for Windows and Linux and extracted it into /home/apps. From the terminal, I ran:
$ mono /home/apps/GitExtensions/GitExtensions.exe
which produced the following error:
Unhandled Exception: System.TypeLoadException: Could not load type 'GitUI.FormChooseTranslation' from assembly 'GitUI, Version=2.40.0.0, Culture=neutral, PublicKeyToken=null'.[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'GitUI.FormChooseTranslation' from assembly 'GitUI, Version=2.40.0.0, Culture=neutral, PublicKeyToken=null'.

While searching for a solution for this, I came across a thread in the Google Group for GitExtensions that led me to downloading MonoDevelop. Apparently even though I had the Mono Runtime and the Mono Runtime (Terminal), MonoDevelop is also needed for GitExtensions to work.

Installed mono software
After installing MonoDevelop, GitExtensions opened with no problem at all. I was able to select my language and configure it for first time use.

One more thing that I wanted was an icon on the launcher so I didn't need to keep running this from the terminal. This post helped me out there. From the terminal run:
$ sudo apt-get install --no-install-recommends gnome-panel
and then to create a launcher:
$ gnome-desktop-item-edit ~/Desktop/ --create-new
The icon can be changed to the GitExtensions icon but you have to first change it to an image format such as .jpeg or .gif. Open the .ico file that came with GitExtensions in an image editing program and save it as a .jpeg or .gif. Then in the Create Launcher window, click on the icon in the top left and select the file that you just created. Give the launcher a name and for its command set it to 'mono' and then the path of GitExtensions.exe. Here is mine:

Git Extensions Launcher
This will place the launcher on the desktop. To move this launcher to the Launcher, just drag and drop it onto the Launcher. You will notice that it appears both in the Launcher and on the desktop. To avoid this, move the launcher from the desktop to another folder such as /home, and then from there, drag it to the Launcher.

3 comments:

  1. Hi,
    thanks for this. Do you have the crashes if you pushes the commit button?

    best Regards
    Jonanova

    ReplyDelete
  2. Two years later and it is still shaky. Fonts are weird, sizes are off, and color diffs dont work. Not sure why it is considered a second class citizen on Linux... this is the best git client around.

    ReplyDelete