git command could not be found and could not find ssh-agent

If you don't want to goof around with reinstalling GitHub or GitShell or if your are not even using that service then you can fix it yourself.

Basically you just need to add the directory pathway of git.exe to your PATH environment variable in Windows.

For me I had to add the path "C:\Program Files (x86)\Git\bin." Or course you may have installed Git in a different directory so you will need to find out where you put it.

Directions for doing all of this can be found here: http://thepracticalsysadmin.com/setting-up-git-in-windows/


It sounds like you recently updated GitHub application and Git Shell is now broken.

Short version

To fix it

  • close Git Shell
  • open GitHub and let it do some post installation.
  • Open Git Shell again and you should be fixed.

Long version

This just happened to me and just to make sure I follow you, you just did this

  • Open Git Shell
  • You are prompted to update GitHub
  • After the update, Git Shell opens

Now it gives the error

git command could not be found. Please create an alias or add it to your PATH.

Warning: Could not find ssh-agent.

If this is the case, do this

  • Close Git Shell
  • Now open the GitHub application (not Git Shell).

This will say something along the lines of (not sure of the exact version)

GitHub is extracting git..

Let that go through the process and after it is complete, go open Git Shell and it is fixed. Just worked for me at least.