1

After installing MSysGit on my new Win7 laptop, I moved my users directory (C:\Users) to my D: disk and created a hardlink from C:\Users to D:\Users. This seems to work for most programs, however the git bash shell can no longer seem to find /etc which is located in

  \Users\<user-name>\AppData\Local\VirtualStore\Program Files (x86)\Git\etc

A similar problem is that the shell can longer find the .bash_history which is written to \Users\.bash_history.

I can read the bash_profile from the shell with

 cd d:  
 source /users/David/AppData/Local/VirtualStore/Program Files (x86)/Git\etc\bash_profile

but that's rather nasty. Any suggestions on how to get the shell to find the /etc directory? Or any other approaches that get the bash_profile to be read? (And sorry for switching between / and . I was trying to keep straight usage is Windows vs. *nix shell)

oddly enough, ssh seems to be find \users\.ssh\known_hosts since it is not complaining about finding keys which are stored there.

Llaves
  • 683
  • 7
  • 20

1 Answers1

0

I would recommend modifying the HOME as defined in git-cmd.bat, as mentioned in:

Set HOME to the actual new path.
Support for windows hard link and msys session is not a sure thing.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I set an environment var HOME to d:\users\. Once in the shell, ~ reflects the correct path, but the bash_profile is still not being read (none of the aliases defined there are appearing). I'm not sure if it's relevant, but I've also noticed for the first time that when the shell starts there is an error message that it couldn't unlink /etc/msys-1.0.dll.md5. Other posts suggest this is harmless, but I don't know if it's related. – Llaves Jan 09 '13 at 15:31
  • The error message prompted an idea. There appear to be two locations where git is looking for /etc (though that makes no sense). In any event, I copied bash_profile to c:\Program Files (x86)\Git\etc and now it is being read. I'm more than a little baffled as to what is going on, but at least it's working now. – Llaves Jan 09 '13 at 15:36
  • @Llaves how are you launching your "bash session" for git? Would a program like https://github.com/msysgit/msysgit/blob/master/share/WinGit/Git%20Bash.vbs work better? – VonC Jan 09 '13 at 18:55
  • As I read it, the VB file at the link you present resolves a problem having to do with launching the shell in the current directory (being the directory of your repository.) That's not the problem I'm having - the shell is just not seeing the /etc directory which is below \users\user-name. I launch the shell using the shortcut created by the msysgit installer. That shortcut has exactly the same content as does the shortcut created by the VB script. It's just that it's in the installed directory, not the current git directory. – Llaves Jan 10 '13 at 03:59
  • 1
    @Llaves rather than creation an hard link to move your profile, could you rather follow http://www.sevenforums.com/tutorials/87555-user-profile-change-default-location.html? (as in http://superuser.com/a/508866/141) – VonC Jan 10 '13 at 06:47
  • I suppose that might work, though I'm not sure why the results would be any better - after all, that requires the program to read the registry, not merely follow the link, which should be invisible to it. But the bottom line is that I'm tired of mucking around configuring this laptop and have work to do. Since I have a workaround, I'll just let it be. Perhaps next time I'm setting up a system, I'll try the method you linked to. Thanks. – Llaves Jan 10 '13 at 17:22