File size: 653 Bytes
9085444
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@echo off
call environment.bat passive
setlocal enabledelayedexpansion
ECHO.
pushd "%~dp0\webui"

set "current_branch="
for /f "delims=" %%C in ('git rev-parse --abbrev-ref HEAD 2^>nul') do set "current_branch=%%C"

if not defined current_branch (
    echo Current branch: [no branch information available]
) else if /i "!current_branch!"=="HEAD" (
    echo Current branch: [detached HEAD]
) else (
    echo Current branch: !current_branch!
)
ECHO Trying to update to latest version ...
git pull 2>NUL
if %ERRORLEVEL% == 0 goto :done
ECHO git clone returned errorlevel %ERRORLEVEL%, initiating hard reset ...
git reset --hard
git pull

:done
popd
pause