48 lines
1.3 KiB
PowerShell
48 lines
1.3 KiB
PowerShell
# Branch Consolidation Script
|
|
# Consolidates all Dependabot branches into main
|
|
|
|
Write-Host "Starting branch consolidation..." -ForegroundColor Green
|
|
|
|
# Fetch latest from remote
|
|
Write-Host "Fetching latest from remote..." -ForegroundColor Yellow
|
|
git fetch Origin
|
|
|
|
# Get current branch
|
|
$currentBranch = git rev-parse --abbrev-ref HEAD
|
|
Write-Host "Current branch: $currentBranch" -ForegroundColor Cyan
|
|
|
|
# Ensure we're on main
|
|
if ($currentBranch -ne "main") {
|
|
Write-Host "Switching to main branch..." -ForegroundColor Yellow
|
|
git checkout main
|
|
}
|
|
|
|
# Get all Dependabot branches
|
|
$dependabotBranches = git branch -r --list "Origin/dependabot/*" | ForEach-Object { $_.Trim() }
|
|
|
|
Write-Host "`nFound Dependabot branches:" -ForegroundColor Cyan
|
|
$dependabotBranches | ForEach-Object { Write-Host " - $_" }
|
|
|
|
Write-Host "`nNote: Dependabot branches should be merged via GitHub PRs" -ForegroundColor Yellow
|
|
Write-Host "This script prepares the consolidation plan." -ForegroundColor Yellow
|
|
|
|
# Create summary
|
|
$summary = @"
|
|
# Branch Consolidation Summary
|
|
|
|
## Dependabot Branches Found
|
|
$($dependabotBranches.Count) branches
|
|
|
|
## Next Steps
|
|
1. Review Dependabot PRs on GitHub
|
|
2. Test each dependency update
|
|
3. Merge approved PRs
|
|
4. Clean up merged branches
|
|
|
|
"@
|
|
|
|
Write-Host "`n$summary" -ForegroundColor Green
|
|
|
|
Write-Host "`nConsolidation plan created!" -ForegroundColor Green
|
|
|