Windows + CMD + TortoiseGit


Another follow up from my previous post about adding a shortcut to TortoiseGit from Git Bash, this time I’m going to add a shortcut to launch TortoiseGit from Windows CMD.

First of all, we need to set up an alias for TortoiseGitProc.exe. It’s a mouthful name and we’ll simplify it to tgit. There’s a utility called doskey that will create such macro/shortcuts. For our purpose, you can execute the following in cmd and have the same experience as Git Bash:

doskey tgit=TortoiseGitProc.exe /command:$*

This command does not persist over different cmd sessions. That means if you close your cmd window, the next one you open, you will have to execute the same command again before you can use the shortcut.

There’s a way to automatically run such commands whenever you open cmd. A complete list of ways can be found on the following StackOverflow question and answers:

I personally chose the Registry mod. I created a file called alias.cmd under my user folder (C:\Users\[User Name]) and use "%USERPROFILE%\alias.cmd" for the registry key value. Include the double quotes if your user name has a space.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.