You can do it using a Script Column which checks if a .git folder exists beneath the folder it is asked about:

And then use that in the label via the Script Column clause:
You might also want to add a clause before that which restricts the test to folders below a certain drive or path, if you know all your Git repo folders will be in one place (but also have other things there that aren't repos; else you could use a simple path wildcard). That way the script column will not be called on every folder everywhere, which would add some overhead after every folder change.
Here is the script:
- Git Repo Column.js.txt (960 Bytes)
Drag it to Preferences / Toolbars / Scripts to install it.
Script code for reference:
function OnInit(initData)
{
initData.name = "Git Repo Column";
initData.version = "1.0";
initData.copyright = "(c) 2020 Leo Davidson";
initData.url = "https://resource.dopus.com/t/label-assignment-using-label-filters-and-contained-subfolders/36311";
initData.desc = "Indicates if a folder contains a .git sub-folder.";
initData.default_enable = true;
initData.min_version = "12.21";
var col = initData.AddColumn();
col.name = "GitRepo";
col.method = "OnColumn";
col.label = "Git Repo";
col.justify = "left";
col.autogroup = true;
}
function OnColumn(scriptColData)
{
if (!scriptColData.item.is_dir)
{
return;
}
var resPath = DOpus.FSUtil.Resolve(scriptColData.item.realpath);
if (DOpus.FSUtil.Exists(resPath + "\\.git"))
{
scriptColData.value = "Yes";
scriptColData.sort = 0; // Sort Yes before No.
}
else
{
scriptColData.value = "No";
scriptColData.sort = 1; // Sort Yes before No.
}
}
