Heroku 从错误的分支推送
我使用 Heroku 的工作流程通常如下:
我在本地保留一个“部署”分支 - 这是我推送的地方。 如果我需要进行更改,我将从 master 分支出来(或者在 master 中工作,如果它很小),将更改提交到分支或 master,然后签出部署。然后,我会将更新的分支合并到我的部署分支中,并从部署中推送 - git push heroku master
上周的某个时候,这对我来说开始崩溃了。作为复制问题的测试,我做了以下操作
- 在我的 master 分支中,我删除了应用程序的徽标,
- 然后将此更改提交到 master 分支
- ,然后签出部署
- 我从不与 master 合并
- git push heroku master
- 徽标在heroku 应用程序上消失。
- 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
- In my master branch, I removed the logo for the application
- I then commited this change to master branch
- I then checkout deploy
- I never merge with master
- git push heroku master
- Logo disappears on heroku app.
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要做的是在本地拥有一个或多个开发分支(这可能包括也可能不包括主分支)。对于使用heroku进行部署,您希望将部署分支推送到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.
From now, everytime you want to deploy, all you need to do is
It will only push your deploy branch because that's all you set up to push to the heroku remote.
Hope this helps.
第 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 deploy
或git 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 fromdeploy
in local tomaster
inheroku
, you must dogit push origin HEAD:master
Generally,
git push origin master
would push a ref with name master ( mostlyrefs/heads/master
). If you have to pushdeploy
you have to usegit push origin deploy
orgit push origin HEAD
I think deploy and master were same or similar enough that you did not notice this before.