简体   繁体   中英

How can I ignore all sub-directories of a hierarchical cross-compiling in git?

I am basically working on the source code a Unix-based micro-kernel. Each library or command-line utility has a hierarchical structure for different architectures such as ARM, MIPS, PPC, x86, and etc. I need to ignore all compiled files under these directories, but since there are many of these sub-directories for each lib/tool, I can't ignore them explicitly one by one. So, I need some sort of regular expression. The best I came up with so far is the following:

trunk/**/arm/le/*
trunk/**/arm/le.*/*
trunk/**/arm/o.le/*
trunk/**/arm/o.le.*/*
trunk/**/arm/a.le/*
trunk/**/arm/a.le.*/*
trunk/**/arm/so.le/*
trunk/**/arm/so.le.*/*
trunk/**/arm/dll.le/*
trunk/**/arm/dll.le.*/*
trunk/**/arm-le/*
trunk/**/arm-le-*/*
trunk/**/arm-o-le/*
trunk/**/arm-o-le-*/*
trunk/**/arm-a-le/*
trunk/**/arm-a-le-*/*
trunk/**/arm-so-le/*
trunk/**/arm-so-le-*/*

I am still interested if I can concise them in a more general way. I tried the following lines as well:

trunk/**/arm/((o|a|so|dll).)?le(.?*)/*
trunk/**/arm-((o|a|so|dll)-)?le(-?*)/*

It didn't work, and I guess it's due to parenthesis. Since I have to repeat the first work around for every architecture, can anyone help me with summarizing these patterns?

The best I came up with is as follows:

trunk/**/arm/*le*/*
trunk/**/arm-*le*/*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM