我可以从 Heroku 部署中提取项目文件吗?
Can I pull down project files from a Heroku deployment?
所以,长话短说 - 由于某种原因,我一直在开发的整个 Web 应用程序都从我的计算机上消失了,我最后一次 github 推送是在一月份(我知道,糟糕的做法)。
该应用程序部署在 Heroku 上 - 有没有一种方法可以改为从 heroku 下拉回购协议?
也许吧。
如果您已经通过 git push
部署到 Heroku,您应该能够通过 运行 heroku git:clone -a APP_NAME
从 Heroku 克隆(或者只使用 git clone
和正确的URL).
This isn't well-supported or recommended:
A Heroku app’s Git repository is intended for deployment purposes only. Cloning from this repository is not officially supported as a feature and should be attempted only as a last resort. Do not use this repository as your app’s canonical “origin” repository. Instead, use your own Git server or a version control service such as GitHub.
如果您一直在从 GitHub 部署,这将不起作用。这些类型的部署 don't populate the Heroku-hosted Git repository。尽管如果您的 GitHub 存储库自 1 月以来未更新,我怀疑您不在这条船上。
如果您使用 Heroku 的 Docker-based 容器部署,您同样无法 git clone
您的代码。但是,您应该可以 fetch the container via heroku container:pull
。您不会以这种方式获取历史记录。
最后,如果上述选项中的 none 适合您,您应该可以 download your application's slug by installing the heroku-slugs
plugin 然后使用 heroku slugs:download -a APP_NAME
。这也不会捕获历史记录。
以后,我强烈建议更频繁地推送到GitHub。一次 is resolved, you should even be able to automatically deploy to Heroku when you push to GitHub.
所以,长话短说 - 由于某种原因,我一直在开发的整个 Web 应用程序都从我的计算机上消失了,我最后一次 github 推送是在一月份(我知道,糟糕的做法)。
该应用程序部署在 Heroku 上 - 有没有一种方法可以改为从 heroku 下拉回购协议?
也许吧。
如果您已经通过 git push
部署到 Heroku,您应该能够通过 运行 heroku git:clone -a APP_NAME
从 Heroku 克隆(或者只使用 git clone
和正确的URL).
This isn't well-supported or recommended:
A Heroku app’s Git repository is intended for deployment purposes only. Cloning from this repository is not officially supported as a feature and should be attempted only as a last resort. Do not use this repository as your app’s canonical “origin” repository. Instead, use your own Git server or a version control service such as GitHub.
如果您一直在从 GitHub 部署,这将不起作用。这些类型的部署 don't populate the Heroku-hosted Git repository。尽管如果您的 GitHub 存储库自 1 月以来未更新,我怀疑您不在这条船上。
如果您使用 Heroku 的 Docker-based 容器部署,您同样无法 git clone
您的代码。但是,您应该可以 fetch the container via heroku container:pull
。您不会以这种方式获取历史记录。
最后,如果上述选项中的 none 适合您,您应该可以 download your application's slug by installing the heroku-slugs
plugin 然后使用 heroku slugs:download -a APP_NAME
。这也不会捕获历史记录。
以后,我强烈建议更频繁地推送到GitHub。一次