未能将一些引用推送到 [email protected]

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9794413/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 13:15:26  来源:igfitidea点击:

failed to push some refs to [email protected]

githerokugit-svn

提问by Maven

I am getting this error when I am trying push my files into heroku rep.

当我尝试将文件推送到 heroku 代表时出现此错误。

Ive set autocrlf = false already in gitconfig but this problem is still there. i have also tried this solution herebut no gain.

我已经在 gitconfig 中设置了 autocrlf = false 但这个问题仍然存在。我也在这里尝试过这个解决方案但没有收获。

Any suggestion is this possible that git is still using old config setting if yes then how can I refresh it.

任何建议都可能是 git 仍在使用旧的配置设置,如果是,那么我该如何刷新它。

Thankyou

谢谢

C:\myapp>git push heroku
To [email protected]:myapp.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:myapp.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details.


while trying git pull heroku master

在尝试的同时 git pull heroku master

warning: no common commits
remote: Counting objects: 215, done.
remote: Compressing objects: 100% (147/147), done.
remote: Total 215 (delta 82), reused 132 (delta 62)Receiving objects:  79% (170/

Receiving objects: 100% (215/215), 1.49 MiB | 107 KiB/s, done.
Resolving deltas: 100% (82/82), done.
From heroku.com:myapp
 * branch            master     -> FETCH_HEAD
Auto-merging start.php
CONFLICT (add/add): Merge conflict in start.php
Auto-merging src/appinfo.txt
CONFLICT (add/add): Merge conflict in src/appinfo.txt
Auto-merging result.php
CONFLICT (add/add): Merge conflict in result.php
Auto-merging landhere.php
CONFLICT (add/add): Merge conflict in landhere.php
Automatic merge failed; fix conflicts and then commit the result.


while trying git push heroku -f

在尝试的同时 git push heroku -f

F:\myapp>git remote add heroku [email protected]:myapp.git
F:\myapp>git push heroku

Counting objects: 41, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (40/40), done.
Writing objects: 100% (41/41), 1.36 MiB | 12 KiB/s, done.
Total 41 (delta 0), reused 0 (delta 0)

-----> Heroku receiving push
 !     Heroku push rejected, no Cedar-supported app detected

To [email protected]:myapp.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:myapp.git'

采纳答案by amcnabb

This error means that the upstream repository has made commits that would be lost if you were to push. First do a "git pull" to merge, and then push again.

此错误意味着上游存储库进行了提交,如果您要推送,这些提交将会丢失。先做一个“git pull”合并,然后再push。

回答by Saulo Falcao

Execute this:

执行这个:

$ rake assets:precompile
$ git add .
$ git commit -m "Add precompiled assets for Heroku"
$ git push heroku master

Source: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book

资料来源:http: //ruby.railstutorial.org/ruby-on-rails-tutorial-book

回答by Alex

In Heroku,you may have problems with pushing to master branch. I just had to start a new branch using

在 Heroku 中,您可能会在推送到 master 分支时遇到问题。我只需要使用

git checkout -b masterbranch

and then push using

然后使用推送

git push heroku masterbranch

please try as above!

请按照上面的方法尝试!

回答by commandantk

I'm the only person working on my app and only work on it from my desktop, so the possibility that I managed to get the heroku repository above dev didn't make sense. BUT! I recently had a Heroku support rep look into my heroku account for a cache issue involving gem installs and he had changed something that caused heroku to return the same error as the one listed above. A git pull heroku masterwas all it took. Then I found the reps minor change and reverted it myself.

我是唯一一个在我的应用程序上工作并且只能从我的桌面上工作的人,所以我设法在 dev 之上获得 heroku 存储库的可能性没有意义。但!我最近让 Heroku 支持代表查看了我的 Heroku 帐户中涉及 gem 安装的缓存问题,他更改了一些导致 heroku 返回与上面列出的错误相同的错误的内容。只需要一个git pull heroku master。然后我发现代表的微小变化并自己恢复了它。

回答by Roshni

If you want to push commit on git repository, plz make sure you have merged all commit from other branches.

如果您想在 git 存储库上推送提交,请确保您已合并其他分支的所有提交。

After merging if you are unable to push commit, Use the push command with -f

合并后如果无法推送提交,请使用带有 -f 的推送命令

git push -f origin branch-name

git push -f origin 分支名称

Where origin is the name of your remote repo.

其中 origin 是远程仓库的名称。

回答by Kirk Strobeck

Make sure you're pushing the right branch. I wasn't on masterand kept wondering why it was complaining :P

确保你正在推动正确的分支。我不在master,一直想知道为什么它在抱怨:P

回答by Ranushka Goonesekere

On my case clearing buildpacks worked heroku buildpacks:clear

在我的情况下清除 buildpacks 工作 heroku buildpacks:clear

回答by JGallardo

For anyone arriving here from a Google search with the same error message. Also be aware that you can have a problem if you are using sqlite3

对于从 Google 搜索到达这里并出现相同错误消息的任何人。另请注意,如果您使用sqlite3,您可能会遇到问题

https://devcenter.heroku.com/articles/sqlite3

https://devcenter.heroku.com/articles/sqlite3

回答by SuperNova

I followed the following steps and it worked for me.

我按照以下步骤操作,它对我有用。

  • Please take a copy of your (local) changes. fetch heroku reset --hard heroku/master Then try to 'git push heroku'.
  • 请复制一份您的(本地)更改。 fetch heroku reset --hard heroku/master 然后尝试'git push heroku'。

回答by harningt

It would appear that you are not fully up-to-date. You would need to do a git pull and either "--rebase" or let it merge into your set.

看起来您没有完全了解最新情况。您需要执行 git pull 并“--rebase”或让它合并到您的集合中。

After this, you should then be able to push, since it would be a 'fast-forward' change that wouldn't remove history.

在此之后,您应该能够推送,因为这将是一个不会删除历史记录的“快进”更改。

Edit: example command list

编辑:示例命令列表

git pull
git push