Sunday, January 8, 2012

Using TortoiseGit UI from posh-git

Over the past six months I've become a massive fan of Git as Version Control System (VCS). In my career I've used the following flavours of Version Control Systems:

  • File system - NOT recommended

  • Visual Source Safe

  • Subversion - under the guise of TortoiseSvn

  • Mercurial - under the guise of TortoiseHg and then using the command line

  • Git - using the command line but also sometimes the TortoiseGit UI.


The latest VCS, Git, (or more specifically Distributed VCS (DVCS)) has been my favourite to use. I truly believe it's speed and features really help the RAD (Rapid Application Development) process.

I currently use Console++ as my powershell command line:



To set this up I used this article by Danny Douglass, A Better Hg Command Line Interface: Console2 + PowerShell + Posh-Hg. I use this Gist to allow the use of both posh-git and posh-hg on the same machine.

One thing I do miss sometimes is TortoiseSvn's GUI especially for checking for modified files. The way you can double click the line to get a diff of the file is excellent.

For a while I've been manually launching TortoiseGit to get the interface:



Until today, today I found a file in posh-git named TortoiseGit.ps1. This gives command line access to TortoiseGit using the following alias tgit.

An example,



tgit commit will launch the TortoiseGit interface. How cool is that.

The commands that can be used are about,log, commit, add, revert, cleanup, resolve, switch, export, merge, settings, remove, rename, diff, conflicteditor, help, ignore, blame, cat, createpatch, pull, push, rebase, stashsave, stashapply, subadd, subupdate, subsync, reflog, refbrowse and sync

Happy Versioning.