当我尝试将我的应用程序推送到Heroku时,我收到了以下回复:
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
我尝试了'heroku键:添加',但仍然会得到相同的结果.我已经为我的GitHub帐户安装了一个ssh密钥.
小智 373
要将Heroku应用程序添加为Git远程,您需要执行heroku git:remote -a yourapp
.
来源:使用Git进行部署
Sti*_*aNX 44
您可以在根目录中尝试以下操作:
//为项目初始化git,添加更改并执行提交
git init
git add .
git commit -m "first commit"
Run Code Online (Sandbox Code Playgroud)
//创建heroku应用程序并推送到heroku
heroku create
git push heroku master
Run Code Online (Sandbox Code Playgroud)
不知道你在这个过程中的位置.你也不需要github在heroku上部署,只需要git.希望这可以帮助!
mep*_*ler 26
首先,确保您已登录heroku:
heroku login
Run Code Online (Sandbox Code Playgroud)
输入您的凭据.
在将克隆的git repo用于新计算机时,通常会出现此错误.即使你的heroku凭证已经在机器上,克隆的repo和heroku之间也没有本地链接.为此,请进入克隆仓库的根目录并运行
heroku git:remote -a yourapp
Run Code Online (Sandbox Code Playgroud)
以下Heroku官方文章:
初始化GIT
$ cd myapp
$ git init
$ git add .
$ git commit -m "my first commit"
Run Code Online (Sandbox Code Playgroud)
然后使用以下命令创建(初始化)heroku应用程序:
$ heroku create YourAppName
Run Code Online (Sandbox Code Playgroud)
最后添加git remote:
$ heroku git:remote -a YourAppName
Run Code Online (Sandbox Code Playgroud)
现在,您可以通过以下方式安全地部署应用程序:
$ git push heroku master
Run Code Online (Sandbox Code Playgroud)
您应该等待一段时间,看看部署时控制台上是否没有任何错误/中断。有关详细信息,请参阅heroku文章。
您忘记将您的应用名称链接到您的 heroku。这是一个很常见的错误。如果您的应用尚未创建,请使用:
heroku create (optional app name)
Run Code Online (Sandbox Code Playgroud)
别的:
git add .
git commit -m "heroku commit"
heroku git:remote -a YOUR_APP_NAME
git push heroku master
Run Code Online (Sandbox Code Playgroud)
请遵循以下步骤:
$ heroku login
Run Code Online (Sandbox Code Playgroud)
创建新的Git存储
库在新目录或现有目录中初始化git存储库
$ cd my-project/
$ git init
$ heroku git:remote -a appname
Run Code Online (Sandbox Code Playgroud)
部署应用程序
将代码提交到存储库并使用Git将其部署到Heroku.
$ git add .
$ git commit -am "make it better"
$ git push heroku master
Run Code Online (Sandbox Code Playgroud)
现有Git存储库
对于现有存储库,只需添加heroku远程存储库即可
$ heroku git:remote -a appname
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
108590 次 |
最近记录: |