.hgignore整个目录树(一个特定文件除外) [英] .hgignore whole directory tree excepting one specific file

查看:72
本文介绍了.hgignore整个目录树(一个特定文件除外)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我.hgignore模式来跟踪目录中的一个特定文件,而忽略其他所有内容吗?

Can anyone tell me the .hgignore pattern to track one specific file in a directory and to ignore everything else?

为了明显的目的,我有一个"media"目录,其中包含"default.png",该目录的其余部分将保存用户媒体.我们希望hg忽略媒体目录中除默认文件之外的所有内容.

I have a "media" directory which contains a "default.png", for obvious purposes, and the rest of the directory will hold user media. We want hg to ignore everything in the media directory excepting the default file.

推荐答案

尝试:

syntax: regex
^media/.*

或(将其保留在默认glob中并执行)

or (leave it in the default glob and do)

media/**

,然后手动hg add media/default.png.

在Mercurial中(与CVS不同),您可以添加与您的忽略模式匹配的文件,并且它们可以正常工作.因此,大致忽略hg add您要跟踪的内容.

In mercurial (unlike in CVS) you can add files that match your ignore patterns and they work fine. So ignore broadly and hg add what you want tracked.

这篇关于.hgignore整个目录树(一个特定文件除外)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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