Skip to content

Instantly share code, notes, and snippets.

@devlead
Created December 8, 2014 18:45
Show Gist options
  • Save devlead/9638825a3380fa473bca to your computer and use it in GitHub Desktop.
Save devlead/9638825a3380fa473bca to your computer and use it in GitHub Desktop.
POSH GIT Batch update remote
gci -Directory -Recurse .git -Hidden|%{pushd;cd (Split-Path -Parent $_);(git remote -v)-split "`n"|%{$r=$_ -split "`t| ";iex "git remote set-url $(if($r[2]-eq"(push)"){"--push "})$($r[0]) $($r[1]-replace ("John","Doe"))"} ;popd}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment