File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,12 @@ echo ========================================
55echo Pulling latest changes from remote...
66echo ========================================
77
8+ REM Get the current branch name
9+ for /f " tokens=*" %%a in ('git rev-parse --abbrev-ref HEAD') do set CURRENT_BRANCH = %%a
10+
811REM Force pull the current branch, discarding any local changes
9- git fetch origin
10- git reset --hard origin/HEAD
12+ git fetch origin %CURRENT_BRANCH%
13+ git reset --hard origin/%CURRENT_BRANCH%
1114
1215echo .
1316echo ========================================
Original file line number Diff line number Diff line change @@ -4,9 +4,12 @@ Write-Host "========================================"
44Write-Host " Pulling latest changes from remote..."
55Write-Host " ========================================"
66
7+ # Get the current branch name
8+ $currentBranch = git rev- parse -- abbrev- ref HEAD
9+
710# Force pull the current branch, discarding any local changes
8- git fetch origin
9- git reset -- hard origin/ HEAD
11+ git fetch origin $currentBranch
12+ git reset -- hard origin/ $currentBranch
1013
1114Write-Host " "
1215Write-Host " ========================================"
You can’t perform that action at this time.
0 commit comments