Skip to content

Instantly share code, notes, and snippets.

@epaulsen
Created February 26, 2025 12:12
Show Gist options
  • Save epaulsen/fa196a9e6f8d603812fd76dfb0aafdab to your computer and use it in GitHub Desktop.
Save epaulsen/fa196a9e6f8d603812fd76dfb0aafdab to your computer and use it in GitHub Desktop.
SparseCheckout
Write-Host "AI-platform sparse checkout setup"
Write-Host "This will configure a new subfolder under the current folder to only contain a single application from the AI-platform repository."
Write-Host "This will also configure the folder to only pull the files for that application."
Write-Host "Folder willl be created in the current directory. If you want to create it elsewhere, please navigate to the desired location before running this script."
Write-Host ""
$folder = Read-Host -Prompt "Enter the name of the application you want to this repo for(case-sensitive)"
# Create folder and navigate to it
md $folder
cd $folder
# init git
git init
git config core.sparseCheckout true
git remote add -f origin [email protected]:aenergi/ai-platform.git
# Sparse checkout the specified app
git sparse-checkout set $folder/
# Add all files at root level
git sparse-checkout add /*.*
# Pull repo from remote
git pull origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment