[windows][documentation] Failed to clone http://github.com/foo/bar.git, git was not found, check that it is installed and in your PATH env #958

Closed
c33s opened this Issue Jul 31, 2012 · 8 comments

Comments

Projects
None yet
6 participants
@c33s

c33s commented Jul 31, 2012

this should be documented here somewhere, composer acts the same way:

https://answers.atlassian.com/questions/55689/on-windows-git-version-is-1-7-10-but-stash-says-git-not-found-in-path-please-install-1-7-6-or-higher

When you install msysgit, you are asked in one of the dialogs how your PATH should be modified.

Use Git Bash Only
Run Git from the Windows Command Prompt
Run Git and included Unix tools from the Windows Command Prompt

If you select option 2. (which I guess most users will pick, as option 3. has a scary warning), the "<...>\Git\cmd" directory will be added to the PATH.
If you pick option 3. the "<...>\Git\bin" directory will also be added.

Now if you run "git --version" from the commadline, it will run "<...>\Git\cmd\git.cmd", which will call "git.exe --version".
Stash however tries to run "git.exe --version".
If you've installed msysgit with option 3. you're fine, as "<...>\Git\bin\git.exe" is in your path.
Did you select option 2. you're out of luck as that directory was not added to your path.

The solution is to either run the msysgit installer again and select option 3. to have your PATH properly set, or edit your PATH manually.

@stof

This comment has been minimized.

Show comment
Hide comment
@stof

stof Jul 31, 2012

Contributor

I installed msysgit with the option 2 and it works well for me.

Contributor

stof commented Jul 31, 2012

I installed msysgit with the option 2 and it works well for me.

@c33s

This comment has been minimized.

Show comment
Hide comment
@c33s

c33s Aug 1, 2012

yes the 2nd option works fine, but if you install it first with option 2 and then with option 3 you have both path in your environment and you get this error

c33s commented Aug 1, 2012

yes the 2nd option works fine, but if you install it first with option 2 and then with option 3 you have both path in your environment and you get this error

@johmue

This comment has been minimized.

Show comment
Hide comment
@johmue

johmue Aug 8, 2012

Same problem here - "git was not found .. check .. your PATH env.".

Changing the PATH env (mentioned above) did not work for me. The problem seems to be in the GitDownloader.php in line 223 where it checks if git is available on the system.

A manual test (mentioned in issue #613 ) with php was successfull.

johmue commented Aug 8, 2012

Same problem here - "git was not found .. check .. your PATH env.".

Changing the PATH env (mentioned above) did not work for me. The problem seems to be in the GitDownloader.php in line 223 where it checks if git is available on the system.

A manual test (mentioned in issue #613 ) with php was successfull.

@Seldaek

This comment has been minimized.

Show comment
Hide comment
@Seldaek

Seldaek Aug 9, 2012

Member

@johmue it only throws this exception if the git download failed and git --version fails too. The latter should always work if git is in your path. Can you try with the latest version of composer (run self-update) to be sure?

Member

Seldaek commented Aug 9, 2012

@johmue it only throws this exception if the git download failed and git --version fails too. The latter should always work if git is in your path. Can you try with the latest version of composer (run self-update) to be sure?

@johmue

This comment has been minimized.

Show comment
Hide comment
@johmue

johmue Aug 9, 2012

Still no git found even though it's in the path and can be used within the plain command window but I'm not sure if it's related to composer or if it is a local problem (e.g. spaces in the path). I'll try to track it down to a single line or command in the next days.

johmue commented Aug 9, 2012

Still no git found even though it's in the path and can be used within the plain command window but I'm not sure if it's related to composer or if it is a local problem (e.g. spaces in the path). I'll try to track it down to a single line or command in the next days.

@bigwhoop

This comment has been minimized.

Show comment
Hide comment
@bigwhoop

bigwhoop Aug 20, 2012

Updating msysgit from Git-1.7.11-preview20120704 to Git-1.7.11-preview20120710 fixed it for me.

Updating msysgit from Git-1.7.11-preview20120704 to Git-1.7.11-preview20120710 fixed it for me.

@Seldaek

This comment has been minimized.

Show comment
Hide comment
@Seldaek

Seldaek Sep 7, 2012

Member

The issue with --enable-sigchild is fixed, hopefully this fixes it for everyone.

Member

Seldaek commented Sep 7, 2012

The issue with --enable-sigchild is fixed, hopefully this fixes it for everyone.

@Seldaek Seldaek closed this Sep 7, 2012

@thomasthiry

This comment has been minimized.

Show comment
Hide comment
@thomasthiry

thomasthiry Oct 6, 2012

Had the exact same problem. I did the exact same upgrade as bigwhoop on msysgit and it worked.

Had the exact same problem. I did the exact same upgrade as bigwhoop on msysgit and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment