-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_git.bat
More file actions
117 lines (105 loc) · 2.74 KB
/
install_git.bat
File metadata and controls
117 lines (105 loc) · 2.74 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
@echo off
REM Git Installation Helper for Windows
REM This script will help you install Git
echo.
echo ========================================
echo Git Installation Helper
echo ========================================
echo.
REM Check if Git is already installed
git --version >nul 2>&1
if not errorlevel 1 (
echo [OK] Git is already installed!
git --version
echo.
echo You can now run: setup_github.bat
pause
exit /b 0
)
echo Git is not installed on your system.
echo.
echo ========================================
echo Installation Options
echo ========================================
echo.
echo 1. Download Git from official website (Recommended)
echo 2. Install using winget (Windows 10/11)
echo 3. View manual installation instructions
echo 4. Exit
echo.
set /p CHOICE="Enter your choice (1-4): "
if "%CHOICE%"=="1" goto DOWNLOAD
if "%CHOICE%"=="2" goto WINGET
if "%CHOICE%"=="3" goto MANUAL
if "%CHOICE%"=="4" goto EXIT
echo Invalid choice. Please try again.
pause
exit /b 1
:DOWNLOAD
echo.
echo ========================================
echo Opening Git Download Page
echo ========================================
echo.
echo Opening https://git-scm.com/download/win in your browser...
echo.
echo After downloading:
echo 1. Run the installer (Git-2.xx.x-64-bit.exe)
echo 2. Click "Next" through the wizard (use default settings)
echo 3. After installation, close and reopen this window
echo 4. Run this script again to verify installation
echo.
start https://git-scm.com/download/win
pause
exit /b 0
:WINGET
echo.
echo ========================================
echo Installing Git using winget
echo ========================================
echo.
echo Checking if winget is available...
winget --version >nul 2>&1
if errorlevel 1 (
echo ERROR: winget is not available on your system.
echo Please use Option 1 to download Git manually.
pause
exit /b 1
)
echo Installing Git...
winget install --id Git.Git -e --source winget
echo.
echo Installation complete!
echo Please close and reopen this window, then run:
echo git --version
echo.
pause
exit /b 0
:MANUAL
echo.
echo ========================================
echo Manual Installation Instructions
echo ========================================
echo.
echo Windows:
echo 1. Go to: https://git-scm.com/download/win
echo 2. Download the installer
echo 3. Run the installer as Administrator
echo 4. Use default settings
echo 5. After installation, open a NEW Command Prompt
echo 6. Verify with: git --version
echo.
echo Alternative - Using Chocolatey:
echo choco install git
echo.
echo Alternative - Using Winget:
echo winget install --id Git.Git -e --source winget
echo.
echo For detailed instructions, see: INSTALL_GIT.md
echo.
pause
exit /b 0
:EXIT
echo.
echo Exiting...
exit /b 0