I recently started using Git, the version control system now used for developing the Linux Kernel. While there is no native support for Windows at the moment, you can install it using cygwin. While this works reasonably well in Windows XP, I got into severe troubles when trying the same in Windows Vista.
First, I ran into troubles installing cygwin. I figured out, that it seems to work well if you run both the installer and bash in “Windows XP SP2 compatibility mode”. I needed to adjust the file system permissions of the cygwin folder to give me write permissions, though. (Note: you have to manually install the TK-libs if you want the GUI elements of git to work.)
But Git kept failing with “access denied” messages when trying to commit from command line. The failure message said it was denied access to git-update-index
. I soon found out this is due to the “User Account Control” (UAC) default behavior of auto-detecting installers and prompting if you want to execute them with raised privileges. You can see if this is the case by running git-update-index
manually from bash; if you get the UAC confirmation dialog you have this problem. It seems the substring “update” triggers this behavior. As the git-update-index
is launched by git commit
, it won’t display the confirmation dialog of Vista, so the execution will be denied.
There are two possible workarounds:
- Run
bash
with administrative privileges (not recommended!)
- Disable the auto-detection of installers by UAC.
I used the latter way. You can disable the auto-detection by following these instructions. Brief summary:
- Open the Local Security Policies
- Disable “User Account Control: Detect application installations and prompt for elevation”
- Reboot (the security policy will not be updated before!)
It should work now. You can confirm this by running git-update-index
manually again. If you do not get the UAC confirmation dialog now, it worked. Try git commit
now, and verify it is working. Of course, you will from now on have to right-click and “Run as Administrator” every installer you want to install, as most installers will require administrative privileges.
Update 2007-08-22: Reader EGarcia posted an interesting comment below: using the Microsoft Manifest Tool you can add an according manifest to the git-update-index.exe and git-update-ref.exe
Update 2009-02-12: Reader Kevin Broadey points out the best solution so far: create a seperate .manifest file for the affected files. He has provided an example for git-update.exe.manifest.