Git推Heroku主错误与Rails [英] Git Push Heroku Master error with Rails

查看:120
本文介绍了Git推Heroku主错误与Rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  matt @ matt-desktop:〜/ Documents / Ruby / rails_projects / ninja_speak_app $ git push heroku master 
到https://git.heroku.com/limitless-inlet-4477.git
! [被拒绝] master - > master(获取第一个)
错误:未能将某些参考文献推送到'https://git.heroku.com/limitless-inlet-4477.git'
提示:由于远程包含工作,更新被拒绝你做
提示:不在本地。这通常是由另一个存储库推动
hint:引起的。在再次推送之前,您可能需要先集成远程更改
提示:(例如,'git pull ...')。
提示:有关详细信息,请参阅'git push --help'中的'关于快速转发的注意事项'。

这个存储库昨天在github上建立,名为ninja_speak_app。设置存储库时,我小心不要使用自述文件或许可证进行初始化。



当我执行git pull时,出现以下内容:

  matt @ matt-desktop:〜/ Documents / Ruby / rails_projects / ninja_speak_app $ git pull 
已经是最新版本。

提交也显示一切都是最新的:

  matt @ matt-desktop:〜/ Documents / Ruby / rails_projects / ninja_speak_app $ git commit -m第一次提交
在分支大师
您的分支是最新的'起源/主'。

没有提交,工作目录干净

编辑:运行git push - -force heroku master产生以下结果:

  matt @ matt-desktop:〜/ Documents / Ruby / rails_projects / ninja_speak_app $ git push --force heroku master 
计数对象:25701,完成。
使用多达8个线程的增量压缩。
压缩对象:100%(25297/25297),完成。
写作对象:100%(25701/25701),104.98 MiB | 97.00 KiB / s,完成。
共25701(delta 322),重用25668(delta 309)
remote:压缩源文件...完成。
remote:构建源:
remote:
remote:构建流超时,恢复轮询....
remote:!超时达成投票结果。
remote:
至https://git.heroku.com/limitless-inlet-4477.git
! [remote rejected] master - > master(pre-receive hook refused)
错误:无法将一些文件推送到'https://git.heroku.com/limitless-inlet-4477.git'



我可以使用--force获取代码至heroku,但是有关它为何仍然出错的任何想法?



Edit2:



运行git pull heroku master yield:

  matt @ matt-desktop:〜/ Documents / Ruby / rails_projects / ninja_speak_app $ git pull heroku master 
警告:没有普通提交
remote:计数对象:69191,done。
remote:压缩对象:100%(45212/45212),完成。
remote:合计69191(增量17653),重复使用68275(增量16751)
收货对象:100%(69191/69191),129.00 MiB | 884.00 KiB / s,完成。
解析三角洲:完成100%(17653/17653)。
从https://git.heroku.com/limitless-inlet-4477
*分支大师 - > FETCH_HEAD
* [新分支] master - > heroku / master
自动打包存储库以获得最佳性能。您也可以
手动运行git gc。有关更多信息,请参阅git help gc。
计数对象:673,完成。
使用多达8个线程的增量压缩。
压缩对象:100%(594/594),完成。
写作对象:100%(673/673),完成。
总计673(delta 239),重用0(delta 0)
错误:以下未跟踪工作树文件将被合并覆盖:
db / development.sqlite3
db / production.sqlite3
db / test.sqlite3
log / development.log
log / production.log
log / test.log
tmp / cache / assets / C12 / AE0 / sprockets%2Fc558458ba9671201141a50f2240184c9
...
...
正在取消

Git push heroku master然后得到:

  matt @ matt-desktop:〜/ Documents / Ruby / rails_projects / ninja_speak_app $ git push heroku master 
到https://git.heroku.com/limitless-inlet-4477.git
! [被拒绝] master - >主(非快进)
错误:未能推动一些裁判'https://git.heroku.com/limitless-inlet-4477.git'
提示:更新被拒绝,因为当前分支的提示位于
提示后面:其远程对象。在再次推送之前,集成远程更改(例如
提示:'git pull ...')。
提示:有关详细信息,请参阅'git push --help'中的'关于快速转发的注意事项'。


解决方案

p>

我登录到我的heroku帐户并转到部署选项卡。从这里有一个'连接到GitHub'选项,这将允许您手动链接这两个帐户。帐户关联后,您可以在heroku帐户上搜索GitHub回购。一旦关联,我选择了手动部署选项。由于此手动部署,我已经能够使用git push heroku master而不会出现问题。


When I attempt the git push heroku master command I get the following error:

matt@matt-desktop:~/Documents/Ruby/rails_projects/ninja_speak_app$ git push heroku master
To https://git.heroku.com/limitless-inlet-4477.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://git.heroku.com/limitless-inlet-4477.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.

This repository was set up yesterday on github and is called ninja_speak_app. While setting up the repository I was careful not to initialize with a readme file or license.

When I do a git pull I get the following:

matt@matt-desktop:~/Documents/Ruby/rails_projects/ninja_speak_app$ git pull
Already up-to-date.

Commit also shows everything is up to date:

matt@matt-desktop:~/Documents/Ruby/rails_projects/ninja_speak_app$ git commit -m "first commit"
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean

Edit: running git push --force heroku master yields the following:

matt@matt-desktop:~/Documents/Ruby/rails_projects/ninja_speak_app$ git push --force heroku master
Counting objects: 25701, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (25297/25297), done.
Writing objects: 100% (25701/25701), 104.98 MiB | 97.00 KiB/s, done.
Total 25701 (delta 322), reused 25668 (delta 309)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: Build stream timed out, reverting to polling....
remote: !   Timeout reached polling for results.
remote: 
To https://git.heroku.com/limitless-inlet-4477.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/limitless-inlet-4477.git'

I'm able to get code up to heroku using --force but any thoughts on why it still errors out?

Edit2:

Running git pull heroku master yields:

matt@matt-desktop:~/Documents/Ruby/rails_projects/ninja_speak_app$ git pull heroku master
warning: no common commits
remote: Counting objects: 69191, done.
remote: Compressing objects: 100% (45212/45212), done.
remote: Total 69191 (delta 17653), reused 68275 (delta 16751)
Receiving objects: 100% (69191/69191), 129.00 MiB | 884.00 KiB/s, done.
Resolving deltas: 100% (17653/17653), done.
From https://git.heroku.com/limitless-inlet-4477
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> heroku/master
Auto packing the repository for optimum performance. You may also
run "git gc" manually. See "git help gc" for more information.
Counting objects: 673, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (594/594), done.
Writing objects: 100% (673/673), done.
Total 673 (delta 239), reused 0 (delta 0)
error: The following untracked working tree files would be overwritten by merge:
    db/development.sqlite3
    db/production.sqlite3
    db/test.sqlite3
    log/development.log
    log/production.log
    log/test.log
    tmp/cache/assets/C12/AE0/sprockets%2Fc558458ba9671201141a50f2240184c9
    ...
    ...
Aborting

Git push heroku master then yields:

matt@matt-desktop:~/Documents/Ruby/rails_projects/ninja_speak_app$ git push heroku master
To https://git.heroku.com/limitless-inlet-4477.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://git.heroku.com/limitless-inlet-4477.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决方案

Here is what ended up working for me:

I logged into my heroku account and went to the 'Deploy' tab. From here there is a 'Connect to GitHub' option which will allow you to manually link the two accounts. After the accounts are linked you can search for the GitHub repo on the heroku account. Once linked, I chose the 'manual deploy' option. Since this manual deploy I've been able to use git push heroku master without issue.

这篇关于Git推Heroku主错误与Rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆