无法将某些引用推送到git@heroku.com:myapp.git
当我试图将我的文件推送到heroku rep时,我遇到了这个错误。 我曾尝试过以下解决方案,但都没有效果:无法将某些引用推送到git@heroku.com:myapp.git,git,heroku,git-svn,Git,Heroku,Git Svn,当我试图将我的文件推送到heroku rep时,我遇到了这个错误。 我曾尝试过以下解决方案,但都没有效果: 尝试了git pull heroku master(结果如下) 尝试了git push heroku-f(结果如下) 设置autocrlf=false 请引导我通过这个 多谢各位 C:\myapp>git init Reinitialized existing Git repository in C:/myapp/.git/ C:\myapp>git add . C:\mya
C:\myapp>git init
Reinitialized existing Git repository in C:/myapp/.git/
C:\myapp>git add .
C:\myapp>git add -u
C:\myapp>git commit -m "ic"
# On branch master
nothing to commit (working directory clean)
C:\ myapp>git push heroku
To git@heroku.com:myapp.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com: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.
尝试
git拉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.
在尝试git时,按下heroku-f
F:\myapp>git remote add heroku git@heroku.com:myapp.git
F:\myapp>git push heroku -f
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 git@heroku.com:myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:myapp.git'
看起来你确实与上游有合并冲突。我建议如下: 1.run
git-fetch-origin
2.运行
git log..origin/master
查看原始版本中的新内容,但您仍然没有。请注意,如果您尝试使用“git push-f”,它将覆盖这些提交。。。
3.运行
git pull--rebase
(这可能会再次失败,因为合并冲突)。在成功拉动和重定基址后,你的推动应该会起作用。然而,我会密切关注这些合并冲突,因为在您的案例中,它们似乎源于混乱的历史(可能是以前的合并/重新基础出错?)
4.如果所有其他操作都失败,则创建一个新分支,指向origin/master(
git checkout-b new\u master origin/master
),然后使用git log
和git cherry pick
,找出与origin/master相关的唯一真正新的提交。然后推动这个新分支并归档旧的主文件
假设以上四种方法都失败,远程存储库可能会出现问题。看起来您确实与上游存在合并冲突。我建议如下: 1.run
git-fetch-origin
2.运行
git log..origin/master
查看原始版本中的新内容,但您仍然没有。请注意,如果您尝试使用“git push-f”,它将覆盖这些提交。。。
3.运行
git pull--rebase
(这可能会再次失败,因为合并冲突)。在成功拉动和重定基址后,你的推动应该会起作用。然而,我会密切关注这些合并冲突,因为在您的案例中,它们似乎源于混乱的历史(可能是以前的合并/重新基础出错?)
4.如果所有其他操作都失败,则创建一个新分支,指向origin/master(
git checkout-b new\u master origin/master
),然后使用git log
和git cherry pick
,找出与origin/master相关的唯一真正新的提交。然后推动这个新分支并归档旧的主文件
假设上述四种方法都失败,远程存储库可能会出现问题。您说“在尝试
git push heroku-f
”但粘贴的命令行显示没有-f
。@Kristian Glass:对不起,我的错,我复制了错误的命令,我现在更新了我的问题。你解决了冲突吗?@Neil Middleton:如何解决冲突,这就是我想知道的。另外,如果我可以删除回购协议中的所有内容并将我的新内容推送到回购协议中,我只想理清界限,这样我就可以轻松推送我的内容。这似乎与您之前的问题几乎相同,您说“在尝试推送heroku-f时,git push heroku-f
”但是粘贴的命令行没有显示-f
。@Kristian Glass:对不起,我复制了错误的命令,我现在更新了我的问题。你解决了冲突吗?@Neil Middleton:如何解决冲突,这就是我想知道的。另外,如果我可以删除回购协议中的所有内容,并将新内容推送到回购协议中,我只想理清界限,以便轻松推送我的内容。这似乎与你在