no message
This commit is contained in:
21
upstream_sync.ps1
Normal file
21
upstream_sync.ps1
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Sync from upstream to your fork
|
||||||
|
|
||||||
|
# Detect default branch (main/master/etc)
|
||||||
|
$branch = git symbolic-ref --short refs/remotes/origin/HEAD
|
||||||
|
$branch = $branch -replace "origin/", ""
|
||||||
|
|
||||||
|
Write-Host "Default branch detected: $branch" -ForegroundColor Yellow
|
||||||
|
|
||||||
|
Write-Host "Fetching upstream..." -ForegroundColor Cyan
|
||||||
|
git fetch upstream
|
||||||
|
|
||||||
|
Write-Host "Checking out $branch..." -ForegroundColor Cyan
|
||||||
|
git checkout $branch
|
||||||
|
|
||||||
|
Write-Host "Merging upstream/$branch..." -ForegroundColor Cyan
|
||||||
|
git merge upstream/$branch
|
||||||
|
|
||||||
|
Write-Host "Pushing to origin..." -ForegroundColor Cyan
|
||||||
|
git push origin $branch
|
||||||
|
|
||||||
|
Write-Host "✅ Sync complete!" -ForegroundColor Green
|
||||||
Reference in New Issue
Block a user