Gitk is a graphical utility included with Git (under C:\Program Files\Git\cmd), which can show all commits to a repository, or all commits which changed a specific file or folder.

It is the same as the "Git History" option which was included by Git version 1.x in the Windows Explorer context menu. Git version 2.x does not add the context menu entry. You must add it yourself, if you want to be able to invoke Gitk without using the command line.

Note: ONLY do these steps if you are familiar with updating the Registry, because if the Registry becomes corrupted, it can cause Windows to completely stop working.

To add a Git History context menu item for files, add this registry key:
     HKCR\*\shell\GitHistory\command

Update the "(Default)" String value to: "C:\Program Files\Git\cmd\gitk.exe" -- "%1"

(there should be one space both before and after the double dashes)

Now when you right-click a file in Windows Explorer, there should be a "GitHistory" entry in the context menu.

To add a Git History context menu entry for folders, first save the following line to a batch file named "GitHistory.cmd":
     cd "%1" && "C:\Program Files\Git\cmd\gitk.exe" -- "%1"

(there should be one space both before and after the double dashes)

Then add this registry key:
     HKCR\Directory\shell\GitHistory\command

Update the "(Default)" String value to: C:\cmd\GitHistory.cmd "%1"
(change the path to match your batch file location)

Now when you right-click a Git folder in Windows Explorer, there will be a "GitHistory" entry along with the default "Git GUI" and "Git Bash" entries.

If you directly reference the gitk command instead of the batch file in the Directory registry key, the working directory won't be set right, and gitk will not work right.
I have a Windows 7 computer with Git installed.

In both Eclipse Kepler and Eclipse Luna, when I open Preferences - Team - Git - Configuration, and select the System Settings tab, there is a Browse button which lets me select my Git install folder. Selecting this folder causes the page to be automatically updated with the Git system-wide settings.

In Eclipse Mars, there is no Browse button, and the other buttons are disabled, so I can't load the Git system-wide settings. It seems like a bug. Has anyone else had this problem?

The Mars version of the Eclipse Help, like the prior versions, still indicates that there should be a Browse button:
If you use Git for Windows as a companion to EGit, make sure EGit knows where Git is installed so it can find the "system wide settings", e.g. how core.autocrlf is set. Go to the settings and look under Team>Git>Configuration and then the System Settings tab.

If you selected one of the options to use Git from the Command Line Prompt when you installed Git for Windows, then the location of the system wide settings is filled in with a path and everything is fine. If not, use the Browse button to locate where Git is installed, e.g. C:\Program Files(x86)\Git.


My user settings are picked up okay from my %HOMEDRIVE%\%HOMEPATH% folder. I've tried defining a HOME environment variable, but that made no difference. The Browse button was still missing.

I tried adding my Git folder to my PATH, and that made no difference either. But now I don't remember if I had added the install folder or the bin folder to my PATH... I suppose I can do that test again.

Update: A workaround for the problem is to put your Git bin folder in your PATH environment variable. See comment below.

Profile

djinncoyote

May 2025

S M T W T F S
    123
45678910
11121314151617
181920 21222324
25262728293031

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags