This commit is contained in:
unknown 2025-08-24 15:55:59 +08:00
parent 8acda730f8
commit 41d8df090b

View File

@ -4,15 +4,27 @@ set "remoteRepo=https://HiNC-Public-Client:HiNCProduct20241117@superhightech-git
"%git%" clone "%remoteRepo%" HiNC "%git%" clone "%remoteRepo%" HiNC
cd HiNC cd HiNC
"%git%" remote set-url origin "%remoteRepo%" "%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_FILE=appsettings.json"
set "APP_BAK=%~dp0appsettings.json.bak" 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%" 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 "%git%" fetch --all
echo Resetting working tree to origin/master...
"%git%" reset --hard origin/master "%git%" reset --hard origin/master
echo Cleaning untracked files and directories...
"%git%" clean -fd "%git%" clean -fd
echo Restoring %APP_FILE% from backup (if exists)...
if exist "%APP_BAK%" copy /Y "%APP_BAK%" "%APP_FILE%" if exist "%APP_BAK%" copy /Y "%APP_BAK%" "%APP_FILE%"
echo Done.
cd .. cd ..