Update oneshot installation to clone repository locally

- Modified install.ps1 to clone git-workshop repository to ~/git-workshop
- Added option to remove existing directory before cloning
- Updated documentation to reflect the new behavior
- Now provides complete setup: install tools + clone repo in one command
- Similar to Scoop's get.scoop.sh installation pattern
This commit is contained in:
Bjarke Sporring
2026-01-14 16:29:09 +01:00
parent 34f2607b22
commit e7ce41cbbc
3 changed files with 52 additions and 4 deletions

View File

@@ -4,12 +4,17 @@ This guide will help you install everything needed for the Git Workshop on Windo
## Quick Start (Automated Installation)
**Easiest option:** Run our oneshot installation script that downloads everything and installs all required tools automatically.
**Easiest option:** Run our oneshot installation script that installs all prerequisites and clones the repository automatically.
```powershell
irm https://git.frod.dk/floppydiscen/git-workshop/raw/branch/main/install.ps1 | iex
```
This will:
- Install PowerShell 7, Git 2.23+, and Visual Studio Code
- Clone the git-workshop repository to `~/git-workshop`
- Leave you ready to start the workshop immediately
**Alternative:** If you've already cloned the repository, you can run the local installation script:
1. Open **PowerShell** or **Windows Terminal**

View File

@@ -82,12 +82,17 @@ Then run scripts using:
**Quick Automated Installation (Windows 11):**
**Option 1: Oneshot Installation (Recommended)**
Download and run everything in one command:
Download, install prerequisites, and clone the repository in one command:
```powershell
irm https://git.frod.dk/floppydiscen/git-workshop/raw/branch/main/install.ps1 | iex
```
This will:
- Install PowerShell 7, Git 2.23+, and Visual Studio Code
- Clone the git-workshop repository to `~/git-workshop`
- Leave you ready to start the first module
**Option 2: Local Installation**
Clone the repository first, then run:

View File

@@ -197,6 +197,38 @@ catch {
Write-Host " You can manually delete: $tempDir" -ForegroundColor Yellow
}
# Clone the repository locally
Write-Step "Cloning Git Workshop Repository"
$cloneDir = Join-Path $HOME "git-workshop"
try {
if (Test-Path $cloneDir) {
Write-Warning "Directory already exists: $cloneDir"
$response = Read-Host " Do you want to remove it and clone fresh? (y/n)"
if ($response.Trim().ToLower() -eq 'y' -or $response.Trim().ToLower() -eq 'yes') {
Remove-Item -Path $cloneDir -Recurse -Force
Write-Host " Removed existing directory" -ForegroundColor Gray
}
else {
Write-Host " Skipping clone - using existing directory" -ForegroundColor Gray
}
}
if (-not (Test-Path $cloneDir)) {
Write-Host " Cloning to: $cloneDir" -ForegroundColor Gray
git clone "https://git.frod.dk/floppydiscen/git-workshop.git" $cloneDir
Write-Success "Repository cloned successfully!"
}
}
catch {
Write-Error "Failed to clone repository: $_"
Write-Host ""
Write-Host "You can clone manually:" -ForegroundColor Yellow
Write-Host " git clone https://git.frod.dk/floppydiscen/git-workshop.git ~/git-workshop" -ForegroundColor White
exit 1
}
# Final instructions
Write-Step "Installation Complete"
@@ -204,11 +236,17 @@ Write-Host ""
Write-Success "Git Workshop installation is complete!"
Write-Host ""
Write-Host "Repository cloned to: $cloneDir" -ForegroundColor Green
Write-Host ""
Write-Host "Next steps:" -ForegroundColor Cyan
Write-Host " 1. Clone or download the Git Workshop repository" -ForegroundColor White
Write-Host " 2. Configure Git if you haven't already:" -ForegroundColor White
Write-Host " 1. Configure Git if you haven't already:" -ForegroundColor White
Write-Host " git config --global user.name `"Your Name`"" -ForegroundColor Gray
Write-Host " git config --global user.email `"your.email@example.com`"" -ForegroundColor Gray
Write-Host ""
Write-Host " 2. Navigate to the workshop:" -ForegroundColor White
Write-Host " cd $cloneDir" -ForegroundColor Gray
Write-Host ""
Write-Host " 3. Start with the first module:" -ForegroundColor White
Write-Host " cd 01-essentials\01-basics" -ForegroundColor Gray
Write-Host " .\setup.ps1" -ForegroundColor Gray