Created
February 3, 2021 05:17
-
-
Save stopthatastronaut/0dfa0dcde4ed8e306bf7126e22b3abb3 to your computer and use it in GitHub Desktop.
powershell/git: Have files changed in subfolders?
This file contains hidden or 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
Get-ChildItem -Directory | ForEach-Item { | |
$folder = $_.Name | |
$LATEST_COMMIT = $(git rev-list -n 1 --no-merges HEAD) | |
$FOLDER1_COMMIT = $(git log -1 --format=format:%H --full-diff ./${folder}/) | |
Write-Output $folder | |
Write-Output "latest commit $LATEST_COMMIT" | |
Write-Output "folder commit $FOLDER1_COMMIT" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the hashes match, files have changed. Kinda useful in some CI scenarios.