在Heroku上清理git repo [英] Clean git repo on Heroku

查看:80
本文介绍了在Heroku上清理git repo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

情况如下:

我们有一些项目保留在Github上,并将其部署到具有自己的微型Git的Heroku中.一些更改直接应用于Heroku(从Heroku复制克隆的存储库,进行更改并推送).同时,Github上的master分支也进行了一些更改.

We have some project which persists on Github, and deploy it to Heroku, which has its own mini-Git. Some changes were applied directly to Heroku (cloned repository from Heroku, made changes and pushed). In a meanwhile the master branch on Github has gained also some changes.

现在,当我要将主存储库推送到Heroku时,推送失败,因为Heroku上的提交与本地提交不同步.

Now when I want to push the main repository to Heroku, pushing fails because commits on Heroku are out of sync with local commits.

我不想与Heroku上的更改合并-我只希望它们消失.

I do not want to merge with changes on Heroku - I just want them to vanish.

是否有某种方法可以清除Heroku上的git存储库,从而从一开始就推送我的本地存储库?

Is there some way to clean git repository on Heroku to push then my local repo from the very beginning?

我不想销毁应用程序并重新创建它,因为它具有一些付费服务,而我只是一个合作者.

I do not want to destroy application and recreate it again because it has some paid services and I am just an collaborator.

推荐答案

您可以在git中使用-f标志(这是标准git标志)来强制执行推送.请参阅开发中心 Git 文档中的旁注.显然,这将覆盖您在Heroku上所做的更改.

You can just use the -f flag in git (it's a standard git flag) to force the push. See the side note in the Dev Center Git doc. This will overwrite those changes you've made on Heroku obviously.

这篇关于在Heroku上清理git repo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆