Eugeniy  Maksimov
Eugeniy Maksimov

Reputation: 1704

How to add "git status" command to Windows Explorer context menu for folder?

I have Tortoise Git, but it works much slower than calling "git status". I wrote the batch file:

cd /d %1
git status
pause
exit

According to this question How add context menu item to Windows Explorer for folders I try to add command as

C:\Windows\System32\cmd.exe /K "C:\BATs\ShowGitStatus.bat %1"

But I get the "The file does not have a program associated with it for performing this action. ..." What I'm doing wrong?

Upvotes: 1

Views: 730

Answers (1)

Eugeniy  Maksimov
Eugeniy Maksimov

Reputation: 1704

  1. Add new Computer\HKEY_CLASSES_ROOT\Directory\shell\GitStatus key in the registry
  2. Add new Computer\HKEY_CLASSES_ROOT\Directory\shell\GitStatus\Command key
  3. Change the default value of the last key to C:\BATs\ShowGitStatus.bat %1
  4. Place listed in question bat file tho the C:\BATs\ folder. Name it ShowGitStatus.bat

This should work.

Upvotes: 1

Related Questions