git - 被拒绝的错误:未能将一些参考资料推送到我的应用程序
问题描述
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.
解决方案
错误消息告诉您问题:
提示:更新被拒绝,因为远程包含您所做的工作...您可能希望在再次推送之前先集成远程更改(例如,'git pull ...')
自从您拉出远程分支后,它就继续前进了。您需要将代码合并到此分支中,然后才能将其推送。
要将这项工作带入您的分支,请发出以下命令:
git fetch
git rebase origin/master
然后再次发出您的git push heroku master
命令。
推荐阅读
- git - git clone 无法解析主机:github.com,而我可以从 github.com curl 和 wget
- python-3.x - Python相当于matlab的 var = char(fread(fid,100,'char'))';
- reactjs - 反应原生回到上一个堆栈
- java - Java 数据类型到 Typescript 类型
- c# - 获取由元组列表的第一个值组成的数组
- c# - 如何从属性中获取 LDAP 嵌套组
- laravel - 共享相同产品但不同分销商的正确雄辩关系是什么?
- ns-3 - 如何在 aodv NS3 中获取和打印移动节点的位置?
- python - 在 mac 终端中执行命令时出现奇怪的语法错误
- javascript - 在firebase中执行mailgun云功能时出现“TypeError:无法读取未定义的属性'catch'”