I have a git repository for an Excel Addin I wrote, so the path is "C:\Program Files\Microsoft Office 15\root\office15\Library\BTRTools" (That 'Library' path is the required install parent of Excel add-ins for them to work properly, so I can't change it). I have UAC turned on in both Win7 and Win8.1. In Win7 everything works fine, however in Win8.1 I get a status of basically 'everything changed' (but even some weirder stuff of files first mentioned as 'deleted' then mentioned again in same status as 'untracked'. The repository is really 'clean', despite what git status says, but I can't pull or do reset --hard or anything.
If I run 'Console2' (the app from which I issue git bash commands from) using the 'Run As Administrator' option, everything works fine and the status is clean (no changes listed). And I can do a pull and any other command correctly.
In both Win7 and Win8.1 I have manually granted Full Access rights to the BTRTools folder for my user (even though I am already part of the Administrators group in both) and verified that Console2 is indeed running as my local user in Win8.1.
Has anyone experienced this problem before and have any ideas on how I can get Console2/git to work properly in Win8.1 without resorting to always running (getting prompted) Console2 in 'Run As Administrator' mode?
Thanks in advance.
Update
I discovered I got the same behavior in Win7 under a specific condition. I wrote a script to batch process several git commands by creating and running a c# Process/ProcessStartInfo and it was displaying the same behavior as the Win8.1 Console2. Calling the exact same commands directly in Win7 console vs the Win7 script (i.e. git status) displayed two different results.
The script (which was written in LINQPad) was running as my current user, but I am assuming that when it created and launched a Process/ProcessInfo it was somehow running under a different user. I was able to correct this problem in my script by providing my credentials
p.UserName = Environment.UserName;
p.Password = new System.Security.SecureString();
foreach( var c in password.ToCharArray() )
{
p.Password.AppendChar( c );
}
Note: I verified that the security groups/settings for the 'my' user in both Win7 and Win8.1 appear to be same (part of Admin group).
Update: Get-ACL Output
I ran Get-ACL | format-list on the /BTRTools directory on both machines. The only difference was that Win8 had 'Application Package Authority' for basically all folders and Win7 did not. Not sure if that hints towards anything.
Update: SOLVED
Thanks to @ian-boyd for pointing me in right direction. On my Win7 machine where Console2/Git work fine, I discovered I had the following file:
C:\Users\terry.aney\AppData\Local\VirtualStore\Program Files\Microsoft Office 15\root\office15\Library\BTRTools.git\index
I'm not sure when that was created. If I removed it, my Console2/Git on Win7 started to 'fail' just like the behavior Win8 was presenting. I restored it on Win7, and copied it over to Win8 and now Console2/Win8 is behaving correctly as well. I've bigger battles to fight so I'm moving on. I don't really understand this, but as a side note, here were some of the steps I tried
- Setting full file/directory access to \Git install directory for Users group per this page
- Turning off Virtualize file and registry write failures to per-user locations per the same page in #1.
- Setting full file/directory access to \Library directory for Users group.
If anyone has any opinions on the 'correct' way to handle this, I'm all ears.