Skip to content

Instantly share code, notes, and snippets.

@h1bay1
Created April 23, 2018 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h1bay1/f1b7007615db2e29ea6f1b506b5c66bd to your computer and use it in GitHub Desktop.
Save h1bay1/f1b7007615db2e29ea6f1b506b5c66bd to your computer and use it in GitHub Desktop.
Cloning the repo
$repoUri = "https://github.com/githubtraining/hellogitworld"
$repoFolder = "hellogitworld"
$checkoutPath = "C:\Temp"
Push-Location
if(!(Test-Path -Path $checkoutPath)){
New-Item -ItemType directory -Path $checkoutPath
}
Set-Location $checkoutPath
if(!(Test-Path -Path “$checkoutPath\$repoFolder”)){
Write-Host(“Cloning $repoUri into $checkoutPath\$repoFolder”)
git clone $repoUri $repoFolder 2>&1 | write-host
}
else {
Set-Location $repoFolder
}
# etc...
Pop-Location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment