summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-01-03 03:21:57 +0800
committer魏曹先生 <1992414357@qq.com>2026-01-03 03:21:57 +0800
commita2c86b8d3475b019d330cc1718d73668233908f2 (patch)
treeda19ade7c40b0c003af49979fc443283b984b47b
parent9681db6957b40089173f5265e7f1ea2e77af1e50 (diff)
Change git pull to fetch and reset in setup scripts
This ensures a clean state by discarding any local changes when updating the documents repository.
-rw-r--r--setup.ps13
-rwxr-xr-xsetup.sh5
2 files changed, 6 insertions, 2 deletions
diff --git a/setup.ps1 b/setup.ps1
index dd25785..b2e48a2 100644
--- a/setup.ps1
+++ b/setup.ps1
@@ -1,7 +1,8 @@
# Setup documents repo
if (Test-Path "docs/Documents/.git") {
Push-Location "docs/Documents"
- git pull origin main
+ git fetch origin main
+ git reset --hard origin/main
Pop-Location
} else {
git clone https://github.com/JustEnoughVCS/Documents.git docs/Documents
diff --git a/setup.sh b/setup.sh
index ac4ecb8..fb2a6d6 100755
--- a/setup.sh
+++ b/setup.sh
@@ -1,6 +1,9 @@
# Setup documents repo
if [ -d "docs/Documents/.git" ]; then
- cd docs/Documents && git pull origin main && cd -
+ cd docs/Documents
+ git fetch origin main
+ git reset --hard origin/main
+ cd -
else
git clone https://github.com/JustEnoughVCS/Documents.git docs/Documents
fi