gpt4 book ai didi

regex - 忽略目录中除一个子文件夹外的所有内容

转载 作者:行者123 更新时间:2023-12-04 15:41:42 27 4
gpt4 key购买 nike

我有一个目录 ~/x7/music/sfx .~/x7/music的根目录下有一些文件和文件夹.
我只需要同步 sfx文件夹并忽略 music 中的任何其他内容.

我尝试了很多变体,但所有变体都是错误的。

ignore = Name music/*
ignorenot = Regex music/sfx/.* (OR just *)

不起作用。

我期待使用类似的东西

ignore = Name music/*^/

最佳答案

我不熟悉同音,但要忽略除 sfx 之外的所有内容,您可以使用

ignore = Regex /root/path/to/music/.*
ignorenot Regex /root/path/to/music/sfx/.*

Documentation Source

There is also an ignorenot preference, which specifies a set of patterns for paths that should not be ignored, even if they match an ignore pattern. However, the interaction of these two sets of patterns can be a little tricky. Here is exactly how it works:

  • Unison starts detecting updates from the root of the replicas—i.e., from the empty path. If the empty path matches an ignore pattern and does not match an ignorenot pattern, then the whole replica will be ignored. (For this reason, it is not a good idea to include Name * as an ignore pattern. If you want to ignore everything except a certain set of files, use Name ?*.)

  • If the root is a directory, Unison continues looking for updates in all the immediate children of the root. Again, if the name of some child matches an ignore pattern and does not match an ignorenot pattern, then this whole path including everything below it will be ignored.

  • If any of the non-ignored children are directories, then the process continues recursively.

关于regex - 忽略目录中除一个子文件夹外的所有内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38268263/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com