mercurial忘记对特定文件的修订更改(mercurial forget revision changes to particular file)

编程入门 行业动态 更新时间:2024-10-14 04:24:58
mercurial忘记对特定文件的修订更改(mercurial forget revision changes to particular file)

在最近的提交中,我意外地包含了对具有生产服务器的密码和敏感信息的设置文件的更改。 我将更改推送到私有存储库,但也有一个公共存储库。 我想将更改推送到公共存储库但是如何避免包含该特定文件中的更改? 它已经在提交中了。

In a recent commit I accidentally included changes to a settings file which had passwords and sensitive information for the production server. I pushed the changes to the private repository but there's also a public repository. I'd like to push the changes to the public repo but how can I avoid including the changes in that particular file from being included? It's already in the commit.

最满意答案

我将更改推送到私有存储库

您是说您在本地提交了更改集,还是将其推送到只有您可以访问的另一个仓库? 你真的跑hg push吗?

但也有一个公共存储库。

更改集是否已将其发布到公共回购中?

基本上,如果变更集是公开的,它就消失了。 这是你无法控制的。 更改服务器上的凭据。

如果更改集仍然是私有的,那么您可能会很幸运。 如果它是本地的,那么你可以使用hg strip来删除更改集,但是要警告它也会删除任何后代。 如果它已经成为任何其他回购的方式,那么你也需要将它从那些中删除。 如果变更集存在于任何地方,那么当你从它们中pull出来时它会回来。

无论如何,可能是时候更改服务器上的凭据了。

I pushed the changes to the private repository

Do you mean you committed the change-set locally, or you pushed it to another repo that only you have access to? Have you actually run hg push?

but there's also a public repository.

Has the change-set made it to the public repo?

Basically if the change-set is public it's gone. It's out of your control. Change the credentials on the server.

If the change-set is still private, you may be in luck. If it's local then you can use hg strip to remove the change-set, but be warned it will also remove any descendants. If it's made it's way to any other repo, then you need to strip it from those too. If the change-set exists anywhere, then it'll come back when you pull from them.

Regardless, it's probably time to change the credentials on the server just to be sure.

更多推荐

本文发布于:2023-08-06 20:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1455074.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   mercurial   forget   file   revision

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!