git 是否可以从 heroku 检索您的源代码?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1376718/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to retrieve your source code from heroku?
提问by archibald
Once you have uploaded your source code to Heroku, is it possible to download it from there if necessary such as in the case of a failure of your local disk?
将源代码上传到 Heroku 后,是否可以在必要时从那里下载它,例如在本地磁盘出现故障的情况下?
Because of heroku's integration with git, I would assume this might be possible at least in theory.
由于 heroku 与 git 的集成,我认为这至少在理论上是可能的。
采纳答案by Mike Buckbee
You are correct, you can do a "git clone", there are Heroku specific directionsfor local editing as well.
你是对的,你可以做一个“git clone”,也有针对本地编辑的Heroku 特定说明。
回答by hzitoun
Just go to https://dashboard.heroku.com/apps/YOUR_APP_NAME/deploy/heroku-git.
只需转到https://dashboard.heroku.com/apps/YOUR_APP_NAME/deploy/heroku-git。
Install the Heroku Toolbelt
安装 Heroku 工具带
Download and install the Heroku Toolbelt
If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key.
如果您还没有,请登录您的 Heroku 帐户并按照提示创建一个新的 SSH 公钥。
$ heroku login
Clone the repository
克隆存储库
Use Git to clone YOUR_APP_NAME's source code to your local machine.
使用 Git 将 YOUR_APP_NAME 的源代码克隆到本地计算机。
$ heroku git:clone -a YOUR_APP_NAME
$ cd YOUR_APP_NAME
Deploy your changes
部署您的更改
Make some changes to the code you just cloned and deploy them to Heroku using Git.
对刚刚克隆的代码进行一些更改,然后使用 Git 将它们部署到 Heroku。
$ git add .
$ git commit -am "make it better"
$ git push heroku master
回答by Bernard Banta
Just run the following, and you'll be good to go:
只需运行以下命令,您就可以开始了:
git clone [email protected]:your_app_name.git
回答by chawkinsuf
For the next person that comes across this and did not deploy using git, https://help.heroku.com/FZDDCBLB/how-can-i-download-my-code-from-heroku
对于下一个遇到此问题且未使用 git 部署的人,https://help.heroku.com/FZDDCBLB/how-can-i-download-my-code-from-heroku
Downloading the application slug
If you have not used git to deploy your application, or using
heroku git:clone
has only created an empty repository, you can download the slug that was build when you application was last deployed. First, install the heroku-slugs CLI plugin withheroku plugins:install heroku-slugs
, then run:heroku slugs:download -a APP_NAME
This will download and compress your slug into a directory with the same name as your application.
下载应用程序段
如果您还没有使用 git 部署您的应用程序,或者 using
heroku git:clone
只创建了一个空存储库,您可以下载上次部署应用程序时构建的 slug。首先,使用 安装 heroku-slugs CLI 插件heroku plugins:install heroku-slugs
,然后运行:heroku slugs:download -a APP_NAME
这会将您的 slug 下载并压缩到与您的应用程序同名的目录中。
回答by Shrinivas
First download and install heroku CLI.
首先下载并安装heroku CLI。
Then run this command:
然后运行这个命令:
heroku login
Login by using your username and password.
使用您的用户名和密码登录。
Then git clone
by using:
然后git clone
通过使用:
heroku git:clone -a APP-NAME
**** OR ****
**** 或者 ****
1) Login to heroku : https://id.heroku.com/
1)登录heroku:https://id.heroku.com/
2) select your app.
2)选择您的应用程序。
3) Select Deploy option.
3) 选择部署选项。
Here you will get all the details with commands for getting the source code.
在这里,您将获得有关获取源代码的命令的所有详细信息。
回答by Nguyen Van Dung
First, you need to install the heroku Toolbelt.
首先,您需要安装heroku Toolbelt。
2nd, generate SSH key by the command: heroku keys:add
2、通过命令生成SSH密钥: heroku keys:add
3rd, clone your repo: git clone [email protected]:__your_repo__.git
第三,克隆你的仓库: git clone [email protected]:__your_repo__.git