Skip to content

Instantly share code, notes, and snippets.

@ezyasin
Created May 21, 2025 15:05
Show Gist options
  • Save ezyasin/bd497138b90771cf3e0a3e186e1e9f16 to your computer and use it in GitHub Desktop.
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.
$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