From 41d8df090b0949f68acfbdbb813aff91f670ee5e Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Aug 2025 15:55:59 +0800 Subject: [PATCH] tune --- HiNC-update.bat | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/HiNC-update.bat b/HiNC-update.bat index 5acb502..f9ecfa7 100644 --- a/HiNC-update.bat +++ b/HiNC-update.bat @@ -4,15 +4,27 @@ set "remoteRepo=https://HiNC-Public-Client:HiNCProduct20241117@superhightech-git "%git%" clone "%remoteRepo%" HiNC cd HiNC "%git%" remote set-url origin "%remoteRepo%" -rem 僅保留 appsettings.json,本次更新其餘內容均以遠端為準 +rem Keep local appsettings.json; align all other content to remote set "APP_FILE=appsettings.json" set "APP_BAK=%~dp0appsettings.json.bak" +echo Backing up %APP_FILE% to %APP_BAK% (if exists)... if exist "%APP_FILE%" copy /Y "%APP_FILE%" "%APP_BAK%" +echo Clearing index flags for %APP_FILE% (no-assume-unchanged / no-skip-worktree)... +"%git%" update-index --no-assume-unchanged --no-skip-worktree -- "%APP_FILE%" +echo Removing local %APP_FILE% to avoid 'not uptodate' conflicts... +attrib -R "%APP_FILE%" >nul 2>&1 +del /f /q "%APP_FILE%" >nul 2>&1 + +echo Fetching latest changes from origin... "%git%" fetch --all +echo Resetting working tree to origin/master... "%git%" reset --hard origin/master +echo Cleaning untracked files and directories... "%git%" clean -fd +echo Restoring %APP_FILE% from backup (if exists)... if exist "%APP_BAK%" copy /Y "%APP_BAK%" "%APP_FILE%" +echo Done. cd .. \ No newline at end of file