We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi there,
Is it possible to set the environment variables for the git commands?
I would like to set GIT_SSH_COMMAND like here: https://stackoverflow.com/a/29754018
GIT_SSH_COMMAND
Is this possible? Can you give me any example?
Thanks, Dom
The text was updated successfully, but these errors were encountered:
Hi, currently not, but you can prepare custom Runner https://github.com/czproject/git-php/blob/master/src/Runners/CliRunner.php and send PR :)
I think Runner can be very simple:
namespace CzProject\GitPhp\Runners; use CzProject\GitPhp\IRunner; class EnvironmentVarsRunner implements IRunner { private $env; private $runner; public function __construct(array $env, IRunner $runner) { $this->env = $env; $this->runner = $runner; } public function run($cwd, array $args, array $env = NULL) { if ($env === NULL) { $env = $this->env; } else { $env = array_merge($this->env, $env); } return $this->runner->run($cwd, $args, $env); } } // usage: $cliRunner = new CzProject\GitPhp\Runners\CliRunner; $envRunner = new CzProject\GitPhp\Runners\EnvironmentVarsRunner([ 'GIT_SSH_COMMAND' => '...', ], $cliRunner); $git = new CzProject\GitPhp\Git($envRunner);
Sorry, something went wrong.
No branches or pull requests
Hi there,
Is it possible to set the environment variables for the git commands?
I would like to set
GIT_SSH_COMMAND
like here: https://stackoverflow.com/a/29754018Is this possible? Can you give me any example?
Thanks,
Dom
The text was updated successfully, but these errors were encountered: