我有一个链接到Bitbucket的Git存储库的网站。此站点是多语言,但我只需要上传到存储库spanish
和english
语言。这里的问题是在几条路径上存在相同的结构。请参阅下面的示例(在多路径上重复相同的语言结构):
system\
cms\
language\
arabic\
brazilian\
chinese_simplified\
chinese_traditional\
czech\
danish\
dutch\
english\
finnish\
french\
german\
greek\
hebrew\
hungarian\
indonesian\
italian\
khmer\
lithuanian\
persian\
polish\
portuguese\
russian\
slovenian\
spanish\
swedish\
thai\
vietnamese\
modules\
addons\
language\
arabic\
brazilian\
chinese_simplified\
chinese_traditional\
czech\
danish\
dutch\
english\
finnish\
french\
german\
greek\
hebrew\
hungarian\
indonesian\
italian\
khmer\
lithuanian\
persian\
polish\
portuguese\
russian\
slovenian\
spanish\
swedish\
thai\
vietnamese\
blog\
language\
...
comments\
language\
...
contact\
language\
...
files\
language\
...
keywords\
language\
...
maintenance\
language\
...
navigation\
language\
...
pages\
language\
...
permissions\
language\
...
redirects\
language\
...
search\
language\
...
settings\
language\
...
sitemap\
language\
...
streams_core\
language\
...
templates\
language\
...
users\
language\
...
variables\
language\
...
widgets\
language\
...
wysiwyg\
language\
...
是否有任何方法或正则表达式.gitignore
支持仅允许spanish
和english
并省略其余内容?
编辑:toydarian解决方案
在@toydarian建议之后,我将这些行添加到.gitignore
文件:
language/arabic/*
language/brazilian/*
language/chinese_simplified/*
language/chinese_traditional/*
language/czech/*
language/danish/*
language/dutch/*
language/finnish/*
language/french/*
language/german/*
language/greek/*
language/hebrew/*
language/hungarian/*
language/indonesian/*
language/italian/*
language/khmer/*
language/lithuanian/*
language/persian/*
language/polish/*
language/portuguese/*
language/russian/*
language/slovenian/*
language/swedish/*
language/thai/*
language/vietnamese/*
但是如图所示,它不起作用,还有其他任何建议或方式吗?
答案 0 :(得分:1)
您可以在shell中使用通配符。 look here
不支持正则表达式。
因此,唯一要为每种语言添加<language>/*
,您要排除在.gitignore
上
这将排除<language>
<language>
是特定语言的占位符,例如&#34;德语&#34;