There are three advanced git commands that I use quite often to keep my commits (and entire history of the branch) clean and tidy. These are:

  • partial add: git add -p someFile.cs
  • interactive rebase on self: git rebase -i HEAD~3
  • hard or mixed (O my Gosh, I forgot something mode) reset: git reset --mixed HEAD^

As you can see above I’m rather git-console person but I thought it might be fun to see how easy these things can be achieved in modern git GUIs for Windows. I chose three of them for my experiment:

I use github for windows right now because it provides really pretty diff view (easier to use than going file after file when running `git diftool`) and I also use it for selecting files for stage/commit (easier to select a file with a mouse than type file names one by one).

Scenario for my test is as follows - imagine you have the C# file that looks like this:

public class Calculator
{
    public static int MultiplyByTwo(int number)
    {
        const int two = 2;
        return number*two;
    }
}

and you apply two changes: add sealed modifier to a class and remove const modifier from two variable.

--- a/calculator.cs
+++ b/calculator.cs
@@ -1,8 +1,8 @@
-public class Calculator
+public sealed class Calculator
{
    public static int MultiplyByTwo(int number)
    {
-        const int two = 2;
+        int two = 2;
        return number*two;
    }
}

Perfect GUI for Git should allow you to do three things:

  • create two commits for these two changes respectively
  • run interactive rebase, where you could squash one into another
  • reset that resulting commit in mixed mode, so you can perform another change

Github for Windows

At the time I am writing this, version 2.7.0.24 has just been released with partial add as a new feature.

GitHub partial add

Unfortunately I don’t see a way to interactively rebase or reset history to a given point.

Default Git Gui

I was surprised that simple, ugly looking default Git Gui does have partial add functionality:

GitGUI partial add

I didn’t find a way to perform an interactive rebase.

GitGUI allows reset operations:

GitGUI reset

It displays the following dialog window, where one can choose the type of reset:

GitGUI reset dialog

SourceTree

This one is a real git power horse. It has all three tested features.

Partial add:

SourceTree partial add

Interactive rebase:

SourceTree interactive rebase

SourceTree interactive rebase dialog

Reset:

SourceTree reset

SourceTree reset

Verdict

SourceTree is a definite winner in this contest. It may not be as pretty as GitHub for Windows but I think I can get use to it. And when it comes to functionality, it is packed with advanced features and it looks like you can give your console day off if you have SourceTree installed.