홀덤사이트Paris Sportif CryptoTous Les Sites De Paris Sportifs BelgiqueMeilleur Casino En Ligne BelgiqueCasino Sans Documents
Exporting the Contents of a Git Repository with PowerShell  
Wednesday, April 23, 2014 at 6:37PM
saveenr

Recently I needed to export all the source code from a Git repository into a Windows fileshare (and once there other operations would be performed.

Below is the PowerShell script I used to accomplish this for a repository on GitHub.

$GITEXE="C:\Program Files (x86)\Git\bin\git.exe"
$REPO="https://github.com/advancedrei/MetaWeblogPortable.git"
$DESTDIR="d:\SourceCodeExport"

# Clean out destination folder
if (Test-Path $DESTDIR)
{
    Remove-Item -Recurse -Force $DESTDIR
}

# Clone from repo to folder
&$GITEXE clone --depth 1 $REPO $DESTDIR

# Remove non-source code files from the destination folder
Remove-Item -Recurse -Force ( join-path $DESTDIR ".git")

As a follow-up, if you do this you may need to ZIP up the results. Check out my previous post explaining how to create ZIPs easily with PowerShell.

 

 

Article originally appeared on viziblr (http://viziblr.com/).
See website for complete article licensing information.

Other interesting websites