Last active
January 12, 2024 20:40
-
-
Save AlexanderSerov/1c43fa99c7efebb922bcd43040331b07 to your computer and use it in GitHub Desktop.
Print commit hashes of repo submodules recursively in powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[string]$target = "HEAD" | |
) | |
function Print-Target { | |
foreach ($str in (git ls-tree -r $target)) { | |
if($str.Split(' ')[1] -eq "commit") { | |
Write-Output $str | |
} | |
} | |
} | |
Print-Target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment