Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find all .git\config files?

I'm trying to find all .git\config files but I cannot figure out how to do it.

When I just use \.git as a pattern, it finds all directories

Get-ChildItem -Path C:\Repositories -Recurse -Hidden |
    Where-Object { 
        $_.FullName -match '\.git'
    } |
    Select-Object FullName

but when I exapnd it to \.git\\config$ to give me only the config files it yields no results:

Get-ChildItem -Path C:\Repositories -Recurse -Hidden |
    Where-Object { 
        $_.FullName -match '\.git\\config$'
    } |
    Select-Object FullName

What am I missing here? Is it because the config file does not have an extension?

I'm using powershell 5.1.

like image 268
t3chb0t Avatar asked May 26 '26 00:05

t3chb0t


1 Answers

config isn't a hidden file, so only showing hidden files is causing it to be ignored.

Get-ChildItem -Recurse -Force | where-object fullname -match '\.git\\config'
like image 189
TessellatingHeckler Avatar answered May 27 '26 14:05

TessellatingHeckler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!