Mav*_*ven 39 git git-svn heroku
当我尝试将我的文件推送到heroku rep时,我收到此错误.
我已经在gitconfig中设置了autocrlf = false但是这个问题仍然存在.我也试过这个解决方案, 但没有收获.
任何建议都可能是git仍然使用旧配置设置,如果是,那么我该如何刷新它.
谢谢
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.
Run Code Online (Sandbox Code Playgroud)
在尝试时 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.
Run Code Online (Sandbox Code Playgroud)
在尝试时 git push heroku -f
F:\myapp>git remote add heroku git@heroku.com: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 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'
Run Code Online (Sandbox Code Playgroud)
amc*_*abb 34
此错误意味着上游存储库已提交了如果您要推送将丢失的提交.首先做一个"git pull"合并,然后再次推送.
小智 15
执行:
$ rake assets:precompile
$ git add .
$ git commit -m "Add precompiled assets for Heroku"
$ git push heroku master
Run Code Online (Sandbox Code Playgroud)
资料来源:http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
com*_*ntk 10
我是唯一一个在我的应用程序上工作的人,只能从我的桌面上工作,因此我设法将heroku存储库放在dev上面的可能性没有意义.但!我最近有一个Heroku支持代表查看我的heroku帐户以查找涉及gem安装的缓存问题,并且他更改了导致heroku返回与上面列出的错误相同的错误.一个git pull heroku master是所有花.然后我发现代表们进行了微小的改变并自己将其还原.
小智 10
Try Using
git push heroku main
Run Code Online (Sandbox Code Playgroud)
instead of
git push heroku master
Run Code Online (Sandbox Code Playgroud)
Reason: Because the default starting branch of git has been changed from master to main that's why your git command is not recognizing master branch and giving you ref error
我有同样的问题,解决方案是
在我的分支中,称为“testBranchSuper”
我用
git checkout -b main
然后我用
git push heroku main
如果您想在 git 存储库上推送提交,请确保您已合并其他分支的所有提交。
合并后如果无法推送提交,请使用带有 -f 的推送命令
git push -f origin 分支名称
其中 origin 是远程仓库的名称。
在Heroku中,您可能无法推送到master分支。我只需要使用开始一个新的分支
git checkout -b masterbranch
Run Code Online (Sandbox Code Playgroud)
然后使用
git push heroku masterbranch
Run Code Online (Sandbox Code Playgroud)
请按上述方法尝试!
小智 5
如果我不是唯一使用某人“FULL STACK OVERMEGASUPER EASY AND COOL”Udemy 课程的初学者,我正在写这篇文章(并且为了添加到可能的解决方案列表中)。我有以下错误:
remote: -----> Build
remote: Running build
remote:
remote: > shop@1.0.0 build /tmp/build_cb8c8cb5
remote: > cd frontend && npm install && npm run build
remote:
remote: sh: 1: cd: can't cd to frontend
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 2
remote: npm ERR! shop@1.0.0 build: `cd frontend && npm install && npm run build`
remote: npm ERR! Exit status 2
remote: npm ERR!
remote: npm ERR! Failed at the shop@1.0.0 build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote: ! Push rejected to shop.
remote:
To https://git.heroku.com/shop.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/shop.git'
Run Code Online (Sandbox Code Playgroud)
我几乎尝试了其他用户提供的所有内容。尽管如此,没有什么能解决我的问题。然后,我终于变得足够多管闲事来查看日志(出于某种原因,我立即求助于互联网)。
解决方案如下:
这次,构建成功了。这是一个非常愚蠢的错误。终端告诉我出了什么问题,但我没有注意到。
| 归档时间: |
|
| 查看次数: |
103684 次 |
| 最近记录: |