Integrating the Git bash into Console

One of the essential development tools (found on Hanselman’s tools list) is a better command shell.  The regular “cmd.exe” that comes with every version of Windows is quite lame.  Console offers a host of improvements over the build-in command prompt, not least of which is the tabbed interface, allowing me to have one Console window with tabs for different directories/shells.

Another cool feature of Console is that you can host different shell configurations.  And since the git bash is build on top of cmd.exe, it’s pretty straightforward to plug the git bash into Console.

First things first, make sure you have msysgit installed.  You can find the installation instructions from Jason’s Git for Windows Developers series.  Next, you’ll need to install Console, which you can download from the SourceForge site.

After launching Console, we’ll need to add a new tab launcher by navigating to Edit->Settings:

image

In the Settings window that pops up, click the “Tabs” section, then the “Add” button to add a new Tab:

image

This will bring up the settings for the new tab you created.  In the configuration options in the “Main” tab below, I use the following settings (without quotes):

  • Title: “git bash”
  • Icon: “C:Program Files (x86)Gitetcgit.ico”
  • Shell: “C:Program Files (x86)Gitbinsh.exe –login –i”
  • Startup dir: “C:dev”

I installed Git to the “C:Program Files (x86)Git” directory, so this might be different on your machine.  The Icon setting is not necessary, but it’s nice to see the Git icon in a tab for differentiation.  Click “OK” and you can now create a new Git tab:

image

You now have a git bash in a tabbed interface, letting you keep multiple git bashes/command prompts around at once in a nice tabbed interface:

image

You can add tabs for other kinds of command prompts, such as the Visual Studio command prompt (with the correct PATH variables set) and so on.  Next up is trying out posh-git

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Jimmy Bogard

I'm a technical architect with Headspring in Austin, TX. I focus on DDD, distributed systems, and any other acronym-centric design/architecture/methodology. I created AutoMapper and am a co-author of the ASP.NET MVC in Action books.
This entry was posted in Tools. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://www.lostechies.com/members/derick.bailey/default.aspx derick.bailey

    trying to get Console downloaded and running. they only seem to distribute the source code, and i can’t seem to get it to compile. am i missing something obvious?

  • http://www.lostechies.com/members/derick.bailey/default.aspx derick.bailey

    nvm… i’m totally blind. :)

  • http://lozanotek.com/blog Javier Lozano

    Next step is making it your default tab when you start Console2 :)

  • enriquein

    Gonna try this out after lunch. Thanks for posting this!

  • Matt

    Looks like the “dash i” part of the command line you entered got converted into an em dash (long) somehow – so if you copy and paste that into the Console settings window from your blog post it will actually cause the new tab to start up and bomb out – to correct it just use an en (short) dash instead. Putting it up here in case anyone else hits that issue…

  • Joey Vano

    @ Javier, just move it up to the first tab in the settings

    @ Jimmy – Instead of doing “File New”, just use the keyboard shortcuts, CTRL+F1 for creating a new tab with command shell in the first position. CTRL+F2 for opening second position, aka “git bash”.

  • http://www.lostechies.com/members/bogardj/default.aspx bogardj

    @Matt

    Whoops! Looks like I’ll have to pay closer attention to Live Writer next time.

    @Joey

    I love me some shortcuts, thanks!

  • http://sergiopereira.com/blog Sergio Pereira

    I’ve been using Console2 for a while but since I moved to x64 I had all sorts of problems with it. Anyone using it in x64? On the systems I tried I’ve seen it show as a tiny rectangle, or without the scrollbars, or even black text on black background. Really crazy.
    I miss having IRB, PowerShell, cygwin, git-bash, IronPython, etc :) Not that use all of them all the time :)

  • Rui Santos

    @Sergio Pereira

    I’ve been running Console2 on x64 for more than 8 months now with no problem… maybe I have an old build…

  • Arnis L

    I like how customizable visual appearance of console2 is. This is how mine looks like: http://i43.tinypic.com/v2s3zk.jpg (can’t see red pulsating cursor :) .

    Another tip => if appearance.more.styles.caption is unticked, You can drag console2 around holding ctrl. It’s a good idea to specify global hotkey (got ctrl+`) so console2 is accessible anytime with ease. And – if hotkey is defined – it makes no sense for console2 to show up on task bar. :)

    @Sergio using it on windows server2008 x64 with zero problems.

  • Asger

    @Matt: Thanks for pointing that out! :)

  • Anonymous

    Great!!! Tutorial .. Simple and elegant … Infact Console is very promising in itself

  • http://twitter.com/adamjford Adam Ford

    Hey, I know this article is pretty old, but my co-worker referenced it today, and we noticed that the slashes in the paths are missing.

  • alble

    Very nice. Why MS goes out of their way to make the command window unresizable is a mystery to me. But console + git bash is abig productivity booster

  • Pingback: Visual Studio Command Prompt in Console | Jimmy Bogard's Blog

  • http://pulse.yahoo.com/_V4K6QG236V6DNHR7T3AYTKNALA EMAILT

    oh man this is awesome, thank you… 

    @6065906a08ee2df2b20592fe34c6c166:disqus ”Why MS goes out of their way to make the command window unresizable is a mystery to me”

    because the other one just works, one wise man once said “innovation is not in M$ DNA..”

  • Jomofrodo

    Nice – thanks for taking the time to leave the breadcrumbs for little lost travelers like myself.

  • http://twitter.com/CarlDotNet Carl Sixsmith

    Cheers for this. Most useful.

  • Nico Mommaerts

    sweet! was looking for this

  • Pingback: An alternative to Windows console window | Gualtiero Testa

  • agtb

    I got this working using your guide. Thanks!

    After being stuck with Windows and unusable colours (dark blue on black) and fonts I can really appreciate being able to read the console again!

    P.S. I think your blog has eaten some of the slashes in the Windows paths:
    e.g. C:Program Files (x86)Gitetcgit.ico

  • Jonathan Cameron

    Thank you :)

  • Pingback: Day 2 NSS – JavaScript already?! | Windows alternatives | Hyperbolic Time Chamber

  • http://careers.stackoverflow.com/pothi Pothi Kalimuthu

    Thanks for sharing. It was a pain to work without tabs on ‘Git Bash’. This solution solved it.