Sep 16, 2011

Windows Git Environment


This article describes the installation and configuration of Git on Windows and its primary audience is intended to be Developers wanting to get a setup a local Git installation to get up and running quickly on Windows. The following is covered:
  • Installing Git on Windows (5 min)
  • Installing Visual Studio and Monodevelop integration into Git (5 min)
  • Installing Windows Explorer integration into Git (0 min)
  • Installing CLR Bindings for development against Git repositories (10 minutes)
The article does not compare and contrast different Git software tools, it simply records the results of my investigations into the available toolset. The article may change from time to time and will not be supplanted by a new post, instead this post will be edited to reflect my latest Stack and Environment choices for Git on Windows.

Installing Git on Windows with Explorer Integration

TortoiseGit is my choice for Windows Git integration. It provides Windows Explorer integration into Git commands. However, since I prefer to work with a CLI interface and am familiar with Git, I also install Gits own installation for windows. If you install both you should be careful to select whether you want Windows Explorer context menus for Git since TortoiseGit already provides these for you.
image
Being far more comfortable with Unix command line tools I welcome the option to expose some Unix style CLI commands ahead of Windows find.exe and sort.exe (which I never use – do you?)
image
The next option is very important if you are building cross-platform applications. Yes – absolutely check “keep my repositories as Unix style text delimiters and automatically convert to Windows style text delimiters when checking out to windows”. Please think carefully through whether this option is good for you. It is not suitable for you if you check in non-binary files, and may not be suitable for formatted text either. If you are unsure your option is Checkout as-is, commit as-is.
image
Complete the installation and we are set!
image

Installing Visual Studio Git Integration

There are several options here, all good work equally well. If like me you only use VS2010 by default, go Tools->Extension Manager->(search for: Git). Install. Done.
image

Installing Monodevelop Git Integration

Done. It’s the standard Source Code provider for Monodevelop. There is no action to take here!
image

Installing CLR / C# Bindings for development against Git Repositories

Apparently, libgit2sharp ‘has a lot of promise’ so I am keeping an eye on it. At time of this writing though, it is too immature and relies too heavily on knowledge of the Git API for documentation. Its simply not good enough for my needs at this time.
You can find it here. From your project directory, git it from https://github.com/libgit2/libgit2sharp.git.
‘git clone https://github.com/libgit2/libgit2sharp.git’
I recommend the use of GitSharp instead. It is feature complete, has comparatively better documentation and seems to be used in more projects. GitSharp is no longer in active development, the GitSharp team is likewise watching libgit2sharp, believing that it is a superior approach to implementing a set of CLR bindings.
GitSharp documentation is available.Git the source code via...
‘git clone https://github.com/henon/GitSharp.git’
Get the Demo Project here.

0 comments:

Post a Comment