Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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

@c33s
Copy link

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
Copy link
Contributor

stof commented Jul 31, 2012

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

@c33s
Copy link
Author

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
Copy link

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
Copy link
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
Copy link

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
Copy link

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

@Seldaek
Copy link
Member

Seldaek commented Sep 7, 2012

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

@Seldaek Seldaek closed this as completed Sep 7, 2012
@thomasthiry
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants