首页 > 解决方案 > 被拒绝的错误:未能将一些参考资料推送到我的应用程序

问题描述

StackOverflow 上有很多这样的问题,但我似乎找不到最适合我的问题。Git不会推送,错误消息显示错误:未能将一些参考推送到' https://git.heroku.com/aydansheightapp.git '不知道如何从这里开始,我需要正确部署我的应用程序但我'm 一个代码新手,一直停留在这个阶段。感谢您的帮助和耐心!

aydanaslanova@Aydans-MacBook-Pro ~ % heroku git:remote --app aydansheightapp
set git remote heroku to https://git.heroku.com/aydansheightapp.git
aydanaslanova@Aydans-MacBook-Pro ~ % git push heroku master
To https://git.heroku.com/aydansheightapp.git
! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://git.heroku.com/aydansheightapp.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

标签: githeroku

解决方案


错误消息告诉您问题:

提示:更新被拒绝,因为远程包含您所做的工作...您可能希望在再次推送之前先集成远程更改(例如,'git pull ...')

自从您拉出远程分支后,它就继续前进了。您需要将代码合并到此分支中,然后才能将其推送。

要将这项工作带入您的分支,请发出以下命令:

git fetch
git rebase origin/master

然后再次发出您的git push heroku master命令。


推荐阅读