我是 git 和 github 的新手(我之前使用过 Subversion)。我找不到解决方案,如何仅将主分支从我的私有存储库导出到我的生产服务器。
我需要准备一个自动化解决方案(通过结构调用)。我发现 git 有存档命令,但这不适用于 github(我设置了 SSH 密钥):
someuser@ews1:~/sandbox$ git archive --format=tar --remote=git@github.com:someuser/somerepository.git master
Invalid command: 'git-upload-archive 'someuser/somerepository.git''
You appear to be using ssh to clone a git:// URL.
Make sure your core.gitProxy config option and the
GIT_PROXY_COMMAND environment variable are NOT set.
fatal: The remote end hung up unexpectedly
所以我需要另一种方法来做到这一点。我不想在导出中使用来自 git 的任何元文件。当我克隆时,我会将所有这些文件放在 .git 目录中(我不想要),这会下载比我真正需要的更多的数据。
有没有办法通过 ssh 做到这一点?或者我只能通过 HTTPS 下载 zip 文件?