cpliakas / git-wrapper

A PHP wrapper around the Git command line utility.
MIT License
505 stars 68 forks source link

GitWrapper \ Exception \ GitException Unable to find the Git executable. #224

Closed trancongminh132 closed 3 years ago

trancongminh132 commented 3 years ago

Hello I try to call $gitWrapper = new GitWrapper(); It cause exception: GitWrapper \ Exception \ GitException Unable to find the Git executable. Could you help me? Thank you!

I run on laravel controller.

GrahamCampbell commented 3 years ago

Pass the path to your binary: https://github.com/cpliakas/git-wrapper/blob/master/src/GitWrapper.php#L59.

trancongminh132 commented 3 years ago

@GrahamCampbell Thank you. Also, how to pass this param: $gitWrapper->setPrivateKey('');

GrahamCampbell commented 3 years ago

What do you mean?

trancongminh132 commented 3 years ago

@GrahamCampbell I don't know how to set param to this method: setPrivateKey I just try to set like this $gitWrapper->setPrivateKey('/var/www/.ssh/id_rsa'); But it doesn't work

GrahamCampbell commented 3 years ago

What do you mean, "it doesn't work"?

trancongminh132 commented 3 years ago

@GrahamCampbell

debug2: no passphrase given, try next key
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Error occured. I mean what value we need to set for setPrivateKey?

TomasVotruba commented 3 years ago

Thank you for the issue!


The work of this package continues in https://github.com/symplify/symplify

See https://github.com/cpliakas/git-wrapper/issues/225