Last active
September 21, 2018 19:16
-
-
Save MaximRouiller/b18a7abf8e786bc0d862e3b93691fac8 to your computer and use it in GitHub Desktop.
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
Param ( | |
[Parameter(Mandatory = $true)] | |
[string]$RepositoryUrl, | |
[string]$org | |
) | |
$RepositoryName = $RepositoryUrl.Split('/')[4] | |
git clone $RepositoryUrl | |
cd $RepositoryName | |
git checkout -b repositoryurl | |
$newUrl = $RepositoryUrl.Replace($RepositoryUrl.Split('/')[3], $org) | |
Write-Host " <RepositoryUrl>$newUrl</RepositoryUrl>" | |
Write-Host " <RepositoryType>git</RepositoryType>" | |
Write-Host | |
Write-Host " <repository type=`"git`" url=`"$newUrl`" />" | |
Start-Process "code" -ArgumentList "." -Wait | |
git commit -am "fixing repository url" | |
git push --set-upstream origin repositoryurl | |
cd .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment