我为php czproject/git-php使用了这个库,当我尝试签出到另一个分支a时,我得到了这个错误:
Command 'git checkout 'qa'' failed (exit-code 1)我尝试从某个存储库克隆,然后创建一个分支,并在同一函数调用中尝试签出到新分支
use Cz\Git\GitRepository;
//Some code
$this->repo = GitRepository::cloneRepository('/path/to/repository');
//Some code
$this->repo->createBranch('my_branch', TRUE);
local.ERROR: Command 'git checkout 'my_branch'' failed (exit-code 1).发布于 2019-09-19 01:03:20
czproject/git-php/GitRepository.php#createBranch()函数调用checkout() (哪个calls run())
如果上述签出失败,可能是因为工作树中仍有本地更改,这些更改将被覆盖(由于您刚刚克隆了存储库,因此不存在密钥),或者是因为文件名无效(as in here)
https://stackoverflow.com/questions/56434460
复制相似问题