简体   繁体   English

Heroku和Git不能正确更新,推送或拉动

[英]Heroku and Git are not updating, pushing, or pulling properly

I'm literally falling apart at the seams with angry, nervous laughter. 我真的在生气而紧张的笑声中崩溃了。 Someone PLEASE help me... 请有人帮我...

Screenshots: https://medium.com/p/4ff0a5af7f53 截图: https//medium.com/p/4ff0a5af7f53

  1. Run git status , I am on working branch Redesign with nothing to commit and a clean working directory. 运行git status ,我正在Redesign工作分支上,没有要提交的内容,并且目录干净。
  2. Run rails server and navigate to localhost:3000 . 运行rails server并导航到localhost:3000 Yay pretty website, let's just denote it with a variable ABC 耶漂亮的网站,让我们用一个可变的ABC来表示它
  3. Run git push heroku Redesign:master , it tells me everything is up to date 运行git push heroku Redesign:master ,它告诉我一切都是最新的
  4. Navigate to the website... it shows me a website that's totally different, XYZ, from several months ago 导航到该网站...它向我展示了一个与几个月前完全不同的网站XYZ
  5. Ok, so I'm going to humor this, I'm going to navigate to a new branch Rollback and run a git pull from Heroku 好的,所以我要对此加以幽默,我将导航到一个新分支“ Rollback并从Heroku运行git pull
  6. Now on this Rollback branch I'm going to run rails server expecting to see the XYZ old site that I just pulled from Heroku 现在,在此Rollback分支上,我将运行rails server期望看到我刚刚从Heroku中拉出的XYZ旧站点
  7. False, I instead get ABC (and the Sublime code shows the code for ABC as well) 错误,我改为获取ABC(Sublime代码也显示了ABC的代码)

By the way running the push with --force does not help. 顺便说一句,用--force运行推无济于事。 When I run heroku releases there is no record of this push. 当我运行heroku版本时,没有此推送的记录。

WHAT IS HAPPENING???????? 怎么了????????

Sorry if I seem desperate... I've been at this for 2 hours 对不起,如果我看上去很绝望...我已经在这里待了两个小时了

Ok this was dumb of me, @Chris I think you were going to stumble upon it. 好吧,这对我来说是愚蠢的,@克里斯,我想你会偶然发现它的。 I had done a heroku rollback and didn't realize that when you rollback on Heroku, the git repo head commit doesn't change. 我做了一个heroku rollback ,但没有意识到当您在Heroku上回滚时,git repo head提交不会改变。

This is the thread that solved it: heroku rollback didn't update the HEAD remote branch, did it? 这是解决它的线程: heroku回滚没有更新HEAD远程分支,对吗?

git add .
git commit -a -m "Message"

Have you performed these before you try and push? 在尝试推动之前,您是否执行过这些操作? You have to update your local git repo before sending to Heroku 您必须先更新本地git repo,然后才能发送到Heroku

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM