如何仅取消变量的版本?
如果我希望文件中的某些部分不被版本控制,例如密码或类似的内容,有没有办法告诉 Mercurial 这样做?
谢谢
If I want some part even inside a file to not be versioned i.e. like a password or likewise, is there a way to tell mercurial to do this?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不可以。您必须将不需要版本控制的内容移至单独的文件中。然后就不要在存储库中跟踪该文件。
如何实现这一点取决于您的开发堆栈。如果它是一个已编译的项目,则将其作为嵌入式资源包含在内,允许您对其进行编译并在运行时检索值。对单独的文件进行某种
include
是另一种选择。No. You would have to move the stuff you don't want versioned into a separate file. Then just don't track that file in the repo.
How you accomplish that depends on your development stack. If it is a project that is compiled, including it as an embedded resource allows you to compile it in and retrieve the value at runtime. Doing some sort of
include
of the separate file is another option.