이 post은 언급 한 방식으로 git를 내보내는 방법에 대한 세부 정보를 제공합니다. =이 압축 --format
자식 아카이브 HEAD>는 또한 원격 사용 --remote = 옵션을 보관할 수 있습니다
을 archive.zip. GitHub 리모컨에서는 작동하지 않으므로 대신 다운로드 버튼을 사용하는 것이 좋습니다. 다른 원격으로는 제대로 작동해야하며, 에 문제가있는 경우 맨페이지를 확인하십시오. 내가
remote doesn't support protocol
오류가 발생했습니다 모두
GitHub의 및
bitbuck 그것을 시도 할 때
하지만이 방법의 문제이다.
방금 내 컴퓨터에 제네릭 솔루션을위한 코드와 그 컴퓨터에서 작동하는 코드를 작성했습니다. 내가 너와 나눌거야. shell_exec을 사용하여 PHP를 사용하여 쉘 명령을 실행할 수 있습니다. PHP 안전 모드이 설정되어있는 경우
<?php
//clearing a folder named test if it exist(avoiding git errors)
shell_exec('rm -rf test');
//cloning into test folder
shell_exec('git clone https://github.com/nette/sandbox.git test');
//archiving
shell_exec('cd test && git archive HEAD --format=zip > archive.zip');
//copying to root folder
shell_exec('cp test/archive.zip archive.zip');
//removing the temp test folder we created
shell_exec('rm -rf test');
?>
shell_exec이 작동하지 않습니다. 스크립트 등에 대한 적절한 권한을 설정해야 할 수도 있습니다. 하지만 난 당신이 원하는 것을 얻기위한 PHP로 시작하는 생각이 생각합니다.