-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync-dev.bat
More file actions
54 lines (48 loc) · 1.04 KB
/
sync-dev.bat
File metadata and controls
54 lines (48 loc) · 1.04 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@echo off
setlocal
echo Syncing dev branch with master after PR merge...
echo.
echo Fetching latest changes from remote...
call git fetch github
if errorlevel 1 (
echo Error: Failed to fetch from remote
exit /b 1
)
echo.
echo Updating master to latest from remote...
call git checkout master
if errorlevel 1 (
echo Error: Failed to checkout master
exit /b 1
)
call git pull github master
if errorlevel 1 (
echo Error: Failed to pull master
exit /b 1
)
echo.
echo Resetting dev to master...
call git checkout dev
if errorlevel 1 (
echo Error: Failed to checkout dev
exit /b 1
)
call git reset --hard master
if errorlevel 1 (
echo Error: Failed to reset dev to master
exit /b 1
)
echo.
echo Fetching dev branch reference from remote...
call git fetch github dev
echo.
echo Pushing dev to remote...
call git push github dev --force
if errorlevel 1 (
echo Error: Failed to push dev to remote
exit /b 1
)
echo.
echo Done! Dev branch is now synced with master.
call git log --oneline --graph --all --decorate -5
endlocal