我想使用以下命令创建实时环境:
$ php composer.phar create-project amiadogroup/students --repository-url=http://satis.amiadogroup.com --stability=dev targetDir dev-hotfix/Students_Config_1
只要要安装的版本是主分支,这样就可以正常工作。如果我在上面的情况下使用,它会失败并出现以下错误:
[RuntimeException]
Failed to execute git checkout 'hotfix/Students_Config_1' && git reset --hard 'hotfix/Students_Config_1'
error: pathspec 'hotfix/Students_Config_1' did not match any file(s) known to git.
这是因为存储库中添加了2个遥控器,它无法决定使用哪个(两者都相同):
composer ssh://git@stash.amiadogroup.com:7999/st/students.git (fetch)
composer ssh://git@stash.amiadogroup.com:7999/st/students.git (push)
origin ssh://git@stash.amiadogroup.com:7999/st/students.git (fetch)
origin ssh://git@stash.amiadogroup.com:7999/st/students.git (push)
如果我手动执行以下操作然后重新启动安装,我可以使用它。
$ git branch hotfix/Students_Config_1 origin/hotfix/Students_Config_1
$ git checkout hotfix/Students_Config_1
$ php ../composer.phar install
$ php ../composer.phar run-script
如何让它在没有错误的情况下运行,使用这个命令运行?