Git tooling for .NET developers

Many devel­op­ers work­ing on Win­dows stay away from Git. There are many rea­sons for this but from my obser­va­tions and dis­cus­sions I’ve had, the most com­mon can be sum­ma­rized by this tweet by my friend Paul Stovell:

 

can everyone please stop using Git? Mercurial has a better UI (TortoiseHG), I'm sick of Git UI's

I’m not get­ting into holy wars, and I’m not try­ing to con­vince any­one that Git is bet­ter than any other VCS. Instead I’ll walk you through the tool­ing I use to inter­act with Git on Win­dows, with Visual Studio.

Git Exten­sions

First thing you should be get­ting is Git Exten­sions.

Git Extensions context menu

With that, sim­i­lar to Tor­toi­seX fam­ily of tools you get nice con­text menu that gives you access to most com­mon oper­a­tions quickly, via GUI, and with no need to mem­o­rize com­mand line options if you want to avoid it. You can also launch Git com­mand line in the selected folder and then all power of git is at your disposal.

Visual Stu­dio

If you’re a .NET devel­oper, you’ll want to work from within Visual Stu­dio. I’m sure you’ll be happy to learn that Git Exten­sions has a really nice Visual Stu­dio inte­gra­tion as well.

git_extensions_visual_studio

You get two things – a menu with all the options that Explorer con­text menu gives you and more, includ­ing abil­ity to edit .git­ig­nore file (also the tool will gen­er­ate a new .git­ig­nore file for you with Visual Stu­dio spe­cific rules!) and to launch a Git bash. Also you get a Git tool­bar with most com­monly used com­mands: Com­mit, browse, push, pull, stash and access to settings.

The way I usu­ally work with it, is I use Git bash for most oper­a­tions. There’s one excep­tion to that rule though – committing.

git_extensions_commit_window

I think Git Extensions’s Com­mit win­dow is the best of all VCS I’ve worked with. It clearly sep­a­rates files you want to com­mit (in your Index) and files you leave out for now. It clearly shows you sta­tus of each file (new, deleted, mod­i­fied) with dis­tinc­tive, large icons, also it shows you an on-the-fly diff of what changed in any given file, and it’s blaz­ing fast. Mostly the read­abil­ity ben­e­fits are why I stick to the UI for this operation.

Visual Stu­dio Git Source Con­trol Provider

In addi­tion to Git Exten­sions I use another tool called Git Source Con­trol Provider which plugs into stan­dard Visual Stu­dio VCS provider mech­a­nism to give me some addi­tional func­tion­al­ity (you can get the tool via Visual Stu­dio exten­sion manager).

git_source_control_provider

There are a few use­ful capa­bil­i­ties pro­vided by this tool that I tend to rely on quite often (there are more than that as you can read on the tool’s page):

  1. Over­lay icons show­ing you sta­tus of each file in Solu­tion Explorer.
  2. It shows you name of the cur­rent branch in the Solu­tion Explorer bar at the top (see “(mas­ter)” on the screen­shot below), and you will work a lot with branches in Git.
  3. It gives some addi­tional options in the con­text menu.

git_source_control_provider_screenshot

This (plus com­mand line) makes the job very, very sim­ple and quick, and that’s what I stick to on my machine.

There’s one more thing that makes work­ing with Git a plea­sure (espe­cially if you’re work­ing on a team that’s not com­pletely co-located).

Github

I love Github. It has a very clean, sim­ple inter­face that makes going through project his­tory, diff­ing com­mits and code reviews a very sim­ple and fric­tion­less process.

 

Sum­mary

Yes, per­haps those tools lack some eye candy that other tools have but frankly – I don’t care, and nei­ther should you. They are more than enough to let you quickly do what­ever you need to do with your code and don’t stand in your way. And that’s what a good VCS and tool­ing around it should be – some­thing you don’t really have to think about and you can rely on to keep track of what is hap­pen­ing with your code with con­fi­dence. And that’s pre­cisely what Git is – so if you’ve been held back, go ahead, install those tools and give Git a shot – you won’t look back.

  • http://hotgazpacho.org/ Will Green

    Don't for­get Tor­toise­GIT: http://code.google.com/p/tortoisegit/

    • Tim Kel­logg

      I have issues with Tor­toise­Git. I find it dif­fi­cult to fig­ure out where remote branches & heads are when view­ing history.

  • Innerjl

    My friend says that Git UI tools is for guys who don't under­stand Git. For those who thinks Git is an improved SVN. He strongly rec­om­mends com­mand line for Git.

  • http://www.shrinkrays.net Chris

    The biggest prob­lem I find with Git is the lack of HTTP sup­port. It's aimed at very secure check­ins when for per­sonal OS projects you don't really care that much, and being restricted to using SSH and fart­ing about with keys/cygwin is a bit of a pain (for me at least) on Windows.

    • Mark

      Check out PuTTY for man­ag­ing your SSH keys/sessions in Windows

  • http://twitter.com/chrissie1 Chris­ti­aan Baes

    YOu can also use pow­er­con­sole and even make it a bit eassier to do your git things http://blogs.lessthandot.com/index.php/DesktopDev/GeneralPurposeLanguages/powerconsole-and-removing-the-git