Git "unable to determine absolute path of git directory" Git "unable to determine absolute path of git directory" git git

Git "unable to determine absolute path of git directory"


Killing the ssh-agent.exe process works for me.
Note: It is called sh.exe in newer versions of SourceTree (thanks @cowlinator)


Found the solution/workaround! Hurrah!

I was (and still am) using GitHub for Windows, and occasionally it asks me to go to Windows Powershell to fix the repository because sometimes it can't do it automatically, and occasionally it would fail with the above error message.

The reason it was failing for me was not just that my project was on an encrypted drive but, more importantly, that sometimes I would start GitHub for Windows before mounting the encrypted drive (which I manually mount). Even if I then close GitHub for Windows, then mount the encrypted drive, and then relaunch GitHub for Windows it would still come back with the above error, so perhaps not everything GitHubby is being shut down when I close GitHub for Windows.

The workaround for me is to:

  1. Reboot
  2. Mount Drive containing project
  3. Launch GitHub for Windows

...in that order.


You're most likely using PowerShell and a mapped network drive. PowerShell "helpfully" undoes the mapping, so the directory passed to Git is a UNC path which Git doesn't understand.