Heroku 从错误的分支推送

发布于 2024-11-10 14:32:23 字数 506 浏览 1 评论 0原文

我使用 Heroku 的工作流程通常如下:

我在本地保留一个“部署”分支 - 这是我推送的地方。 如果我需要进行更改,我将从 master 分支出来(或者在 master 中工作,如果它很小),将更改提交到分支或 master,然后签出部署。然后,我会将更新的分支合并到我的部署分支中,并从部署中推送 - git push heroku master

上周的某个时候,这对我来说开始崩溃了。作为复制问题的测试,我做了以下操作

  1. 在我的 master 分支中,我删除了应用程序的徽标,
  2. 然后将此更改提交到 master 分支
  3. ,然后签出部署
  4. 我从不与 master 合并
  5. git push heroku master
  6. 徽标在heroku 应用程序上消失。
  7. master 和 heroku/master 都在同一个提交中。

这让我抓狂。这已经是我一年多的工作流程了,我从未遇到过这个问题。有什么线索吗?

My workflow with Heroku has usually been the following:

I keep a 'deploy' branch locally - this is where I push from.
If I need to make a change, I'll branch off of master, (or work in master if it's small), make the change commit to the branch or master, and then checkout deploy. I'll then merge the updated branch into my deploy branch and push from deploy - git push heroku master

Sometime last week, this started breaking down for me. As a test to replicate the issue I did the following

  1. In my master branch, I removed the logo for the application
  2. I then commited this change to master branch
  3. I then checkout deploy
  4. I never merge with master
  5. git push heroku master
  6. Logo disappears on heroku app.
  7. master and heroku/master are both at the same commit.

This is driving me nuts. This has been my workflow for over a year now, and I've never encountered this problem. Any clues?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眼泪淡了忧伤 2024-11-17 14:32:23

您需要做的是在本地拥有一个或多个开发分支(这可能包括也可能不包括主分支)。对于使用heroku进行部署,您希望将部署分支推送到heroku上的远程主服务器。

git push -u heroku +deploy:master

从现在开始,每次您想要部署时,您所需要做的就是

git push heroku

它只会推送您的部署分支,因为这就是您推送到heroku远程的所有设置。

希望这有帮助。

What you need to do is have your development branch or branches locally (this may or may not include master). For deploying w/ heroku, you want to have your deploy branch pushed to the remote master on heroku.

git push -u heroku +deploy:master

From now, everytime you want to deploy, all you need to do is

git push heroku

It will only push your deploy branch because that's all you set up to push to the heroku remote.

Hope this helps.

指尖上得阳光 2024-11-17 14:32:23

第 5 步:git push heroku master

你不应该做 git push heroku deploy 吗?或者如果您想从本地的deploy推送到heroku中的master,则必须执行git push origin HEAD: master

一般来说, git push origin master 会推送名为 master 的引用(主要是 refs/heads/master )。如果你必须推送deploy,你必须使用git push origin deploygit Push origin HEAD

我认为deploy和master是相同或相似的你之前没有注意到这一点。

Step 5: git push heroku master

Shouldn't you be doing git push heroku deploy. Or if you want to push from deploy in local to master in heroku, you must do git push origin HEAD:master

Generally, git push origin master would push a ref with name master ( mostly refs/heads/master ). If you have to push deploy you have to use git push origin deploy or git push origin HEAD

I think deploy and master were same or similar enough that you did not notice this before.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文