我想把我的项目部署到Heroku,而不把我的项目放在github上?这可能是因为我必须执行这些步骤并得到错误。以下是我所执行的步骤
git initgit add myProjectFilesheroku create myprojectname在Heroku上创建一个项目git push heroku master上推送我的项目,我得到了以下错误:错误: src萤光母版不匹配任何。 关于“https:///git.heroku.com/tllwebsocekt.git”错误的一些参考文献:未能推送
git push heroku致命的:当前的分支主没有上游分支。若要推送当前分支并将远程设置为上游,请使用
git推送集-上游heroku主机git push --set-upstream heroku master,但它也抛出了一个错误错误: src萤光母版不匹配任何。 关于“https:///git.heroku.com/tllwebsocekt.git”错误的一些参考文献:未能推送
发布于 2017-10-24 11:24:54
当您git push heroku master时,Heroku将尝试构建您的应用程序
为了成功地推送应用程序,您需要在git commit之后使用git add myProjectFiles,然后为您的应用程序指定构建包:
heroku buildpacks:set heroku/python在指定了构建包之后,添加一个requirements.txt,或者为空,或者添加:
pip freeze > requirements.txt
git add requirements.txt
git commit接下来,您需要指定当您用heroku推送应用程序时,应该运行什么命令Procfile
例Procfile:
worker: python main.py然后:
git add Procfile
git commit最后,heroku将能够构建您的应用程序,它不会拒绝推送:
git push heroku master或者,如果在myProjectFiles 目录中有上述所有内容,则为。
从应用程序目录中初始化git:
cd myProjectFiles
git init
git add *
git commit
heroku create myprojectname
heroku buildpacks:set heroku/python
git push heroku masterhttps://stackoverflow.com/questions/46907846
复制相似问题