Created
May 21, 2025 15:05
-
-
Save ezyasin/bd497138b90771cf3e0a3e186e1e9f16 to your computer and use it in GitHub Desktop.
Recursively sets the Git user.name and user.email configuration for all Git repositories within a specified root directory.
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
$root = "Your Projects Root Path" | |
$name = "Your Name" | |
$email = "your@email.com" | |
Get-ChildItem -Recurse -Directory -Path $root | Where-Object { | |
Test-Path "$($_.FullName)\.git" | |
} | ForEach-Object { | |
Write-Host "Configuring repo at: $($_.FullName)" | |
git -C $_.FullName config user.name "$name" | |
git -C $_.FullName config user.email "$email" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment