问题描述
当我尝试将文件推送到heroku代表时,出现此错误。
我试过以下解决方案,但没有任何帮助:
- 尝试
git pull heroku master
(results below) - 尝试
git push heroku -f
(结果在下面) - 设置autocrlf = false
请引导我完成此操作。
谢谢
C:\myapp> git init
在C中重新初始化了现有的Git仓库/ myapp / .git /
C:\myapp> git add。
C:\ myapp> git add -u
C:\myapp> git commit -mic
#分支主
没有提交(工作目录清洁)
C:\ myapp> git push heroku
至[email protected]:myapp.git
! [被拒绝] master - > master(非快速转发)
错误:未能将某些文件推送到'[email protected]:myapp.git'
为防止您丢失历史记录,非快进更新被拒绝
在再次按下之前合并远程更改(例如'git pull')。有关详细信息,请参阅git push --help的快速转发部分的
'注意事项。
尝试 git pull heroku master
警告:没有公共提交
remote:计数对象:215,完成。
remote:压缩对象:100%(147/147),完成。
remote:共计215(delta 82),重用132(delta 62)接收对象:79%(170 /
接收对象:100%(215/215),1.49 MiB | 107 KiB / s,done。
解析三角洲:100%(82/82),done。
从heroku.com:myapp
*分支大师 - > FETCH_HEAD
Auto-合并start.php
CONFLICT(添加/添加):在start.php中合并冲突
自动合并src / appinfo.txt
CONFLICT(添加/添加):合并src / appinfo中的冲突.txt
自动合并result.php
CONFLICT(添加/添加):在result.php中合并冲突
自动合并landhere.php
CONFLICT(添加/添加):合并landhere.php中的冲突
自动合并失败;修复冲突并提交结果。
尝试 git push heroku -f
F:\myapp> git remote add heroku [email protected]:myapp.git
F:\myapp> git push heroku -f
计数对象:41,完成。
Delta压缩使用最多4个线程。
压缩对象:100%(40/40),完成。
写作对象:100%(41/41),1.36 MiB | 12 KiB / s,完成。
总计41(delta 0),重用0(delta 0)
-----> Heroku接收推送
! Heroku推送被拒绝,没有Cedar支持的应用程序检测到
到[email protected]:myapp.git
! [remote rejected] master - > master(pre-receive hook refused)
错误:未能将一些文件推送到'[email protected]:myapp.git'
似乎你确实已经与上游合并冲突。我建议如下:
1。运行 git fetch origin
2。运行 git log ..origin / master
以查看原始内容你还没有。注意'git push -f'会覆盖这些提交,如果你尝试它的话...
3。运行 git pull --rebase
(这可能会再次因合并冲突而失败)。在成功拉动和重建之后,你的推动应该起作用。不过,我会密切关注这些合并冲突,因为它们似乎来自于一个混乱的历史(也许之前的合并/重组错误?)
4。如果一切都失败了,创建一个新的分支,指向原点/主( git checkout -b new_master origin / master
),然后使用 git-log
和 git-cherry-pick
- 找出真正新增的唯一提交与原产地/主人的关系。然后推送这个新的分支并归档旧的master。
假设上述四种方法都失败了,那么远程仓库中可能存在问题。 $ b
I am getting this error when I am trying push my files into heroku rep.Ive tried following solutions but none helped:
- this
- Tried
git pull heroku master
(results below) - Tried trying
git push heroku -f
(results below) - set autocrlf = false
Kindly guide me through this.
Thank you
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 [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
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
F:\myapp>git remote add heroku [email protected]: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 [email protected]:myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:myapp.git'
It seems like you indeed have merge conflicts with the upstream. I suggest the following:
1. run git fetch origin
2. run git log ..origin/master
to see what's new in the original that you still don't have. Note that 'git push -f' will override these commits if you attempt it...
3. run git pull --rebase
(this might again fail with merge conflicts). After a successful pull and rebase your push should work. I would, however, pay close attention to those merge conflicts since it seems in your case they stem from a garbled history (maybe a previous merge/rebase gone awry?)
4. If all else fails, create a new branch, pointing at the origin/master (git checkout -b new_master origin/master
), and then, using git-log
and git-cherry-pick
- fish out the only commits that are truly new in relation to origin/master. Then push this new branch and archive the old master.
Assuming the above four ways all fail, there might be a problem on the remote repository.
这篇关于未能推动一些裁判[email protected]:myapp.git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!