Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将文件从git推送到heroku_Git_Heroku_Github - Fatal编程技术网

将文件从git推送到heroku

将文件从git推送到heroku,git,heroku,github,Git,Heroku,Github,我有一个名为myapp的rails应用程序。我最近创建了一个git存储库 我使用git push origin master将我的所有文件推送到git,这成功地推送到了我的所有文件。后来,我使用heroku在myapp目录下创建的heroku应用程序创建了heroku应用程序 在使用git-remote-v检查时,我得到了以下结果 heroku git@heroku.com:myappname.git (fetch) heroku git@heroku.com:myappname.git (

我有一个名为
myapp
的rails应用程序。我最近创建了一个git存储库 我使用git push origin master将我的所有文件推送到git,这成功地推送到了我的所有文件。后来,我使用heroku在
myapp
目录下创建的
heroku应用程序创建了heroku应用程序

在使用git-remote-v检查时,我得到了以下结果

heroku  git@heroku.com:myappname.git (fetch)
heroku  git@heroku.com:myappname.git (push)
origin  https://github.com/username/myreponame.git (fetch)
origin  https://github.com/username/myreponame.git (push)
现在我如何将所有文件从git移动到heroku。有人能帮忙吗。

请参阅最后一个答案

通常,一旦您
git推送heroku master
,它将自动部署。所以如果你不想这样,最简单的方法就是把它推到Heroku的另一个分支

但是!不要像对待github/bitbucket/insert Favorite VCS提供商那样对待Heroku。它只是碰巧使用git作为其部署的一部分,因为这样做是错误的™.


因此,最好将代码存储在github中,让heroku处理部署(而不是存储代码)。

我只使用过几次heroku,但是如果你想部署到heroku,我想你应该
git推heroku master
或者类似的东西。我只想将文件从git移动到heroku,而不是直接移动到heroku。我不理解其中的区别。如果您使用
git push heroku master
,您应该将
master
分支中的代码推送到heroku.Erm,我刚才解释过。使用Heroku仅用于部署和托管,而不是源代码控制。我可能仅仅被你的措辞弄糊涂了。我认为通过git进行部署是“做得对”的众多方法之一,而在heroku的git托管是“做得不对”的。这也是你的意思吗?