Skip to content

Instantly share code, notes, and snippets.

@MaximRouiller
Last active September 21, 2018 19:16
Show Gist options
  • Save MaximRouiller/b18a7abf8e786bc0d862e3b93691fac8 to your computer and use it in GitHub Desktop.
Save MaximRouiller/b18a7abf8e786bc0d862e3b93691fac8 to your computer and use it in GitHub Desktop.
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