小编Sed*_*ona的帖子

将远程heroku repo添加到我现有的本地仓库后,无法推送到heroku

这是场景:

1)我的项目合作伙伴和我正在使用github作为我们的代码仓库一起开发Ruby on Rails应用程序.

2)该应用程序在她的github帐户下,她已将我添加为合作者

3)她部署到Heroku并在那里加入我作为合作者

4)我在现有的app目录中使用了以下命令,目的是将现有的Heroku远程应用程序添加为现有本地应用程序的远程应用程序.正如我之前提到的,我现有的本地应用程序已经有了一个远程github

git remote add heroku git@heroku.com:codefellow.git 
Run Code Online (Sandbox Code Playgroud)

5)我做了一些修改并将它们推送到github,所有这些都是最新的

6)然后我尝试使用以下命令推送到heroku

git push heroku master
Run Code Online (Sandbox Code Playgroud)

7)这给了我一个错误,说我的分支的提示落后了,如下所示,但是当我试图从github拉出时,它说我已经更新了,如下图所示

?  code-fellows-alumni git:(master) git push heroku master
To git@heroku.com:codefellow.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com:codefellow.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' …
Run Code Online (Sandbox Code Playgroud)

git ruby-on-rails github heroku git-remote

7
推荐指数
1
解决办法
5440
查看次数

标签 统计

git ×1

git-remote ×1

github ×1

heroku ×1

ruby-on-rails ×1