git gitignore 和 hgignore 的相互转换?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4349043/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 04:48:17  来源:igfitidea点击:

Interconversion of gitignore and hgignore?

gitversion-controlmercurialgitignorehgignore

提问by Ryan C. Thompson

I'm just starting to use hg-git to push some mercurial repositories to github, and I'm realizing that if people check them out using git, they'll need a .gitignore file in the repository. Is there any automated way to convert hgignore to gitignore or vice versa?

我刚刚开始使用 hg-git 将一些 mercurial 存储库推送到 github,并且我意识到如果人们使用 git 检查它们,他们将需要存储库中的 .gitignore 文件。是否有任何自动方法可以将 hgignore 转换为 gitignore,反之亦然?

采纳答案by Skilldrick

If you're just using glob syntax in your hgignore, then all you'd need to do is rename it, and it should just work. If you're using regex syntax then it's going to be a different story...

如果您只是在 hgignore 中使用 glob 语法,那么您需要做的就是重命名它,它应该可以正常工作。如果您使用正则表达式语法,那么情况将是另一回事...