I use git-php in Lumen framework with the following code
try{
$git = new Git();
$remote = env('GIT_URL').$request->code;
$local = storage_path('repo')."/".$request->code;
$repo = $git->open($local);
$repo->execute("config", "user.name", "latexbki");
$repo->execute("config", "user.email", "[email protected]");
$filename = $repo->getRepositoryPath() . '/'.$request->file;
file_put_contents($filename, $request->content);
$repo->addFile($filename);
$repo->commit("test adding notes", "--author=latexbki <[email protected]>");
$repo->push(NULL, ['--repo'=>$remote]);
return response()->json(['status'=>"success", 'message'=>"Changes pushed to remote successfully"], 200);
}catch(\Exception $e)
{
$errormessage = "Draft Controller: ".$e->getMessage()." -- in line ".$e->getLine();
return response()->json(['code'=>500, 'status'=>"error", 'message'=>$errormessage], 500);
}
When I run the code, I get the error
Command 'git push --repo 'https://latex.bki%40gmail.com:[email protected]/62c7951c097b4c6fdf2980b4' --end-of-options' failed (exit-code 129). error: unknown option end-of-options
I previously get the same error from addFile and I resolve it by commenting the end-of-option part.
My questions are:
- Is it okay if I commented the end-of-option part? The code run just fine with the option commented out
- Is it maybe related to the git version? For information, I am using a rather old server with git version 2.7.4
Thank you very much
I use git-php in Lumen framework with the following code
When I run the code, I get the error
Command 'git push --repo 'https://latex.bki%40gmail.com:[email protected]/62c7951c097b4c6fdf2980b4' --end-of-options' failed (exit-code 129). error: unknown option end-of-optionsI previously get the same error from addFile and I resolve it by commenting the end-of-option part.
My questions are:
Thank you very much