Skip to content

Instantly share code, notes, and snippets.

@AlexanderSerov
AlexanderSerov / gist:1c43fa99c7efebb922bcd43040331b07
Last active January 12, 2024 20:40
Print commit hashes of repo submodules recursively in powershell
param (
[string]$target = "HEAD"
)
function Print-Target {
foreach ($str in (git ls-tree -r $target)) {
if($str.Split(' ')[1] -eq "commit") {
Write-Output $str
}
}