-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-setup.bat
More file actions
55 lines (44 loc) Β· 1.38 KB
/
git-setup.bat
File metadata and controls
55 lines (44 loc) Β· 1.38 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
@echo off
:: π Git Full Auto Setup & Push by Abdul Mueed
title π GIT INIT & PUSH - Abdul Mueed π»
echo ======================================================
echo πΎ Welcome, Abdul Mueed β Letβs push this repo in style
echo ======================================================
echo.
:: Check if git is installed
git --version >nul 2>&1
if %errorlevel% neq 0 (
echo β Git not found! Please install Git first.
pause
exit /b
)
:: Ask for GitHub repo URL
set /p repoUrl=π Enter your GitHub repo URL (e.g. https://github.com/username/repo.git):
:: Initialize git (if not already)
if not exist ".git" (
echo π§© Initializing Git repository...
git init
) else (
echo π Git repo already initialized.
)
:: Add all files
echo β Adding files...
git add .
:: Commit with message
set /p msg=π¬ Enter commit message (default: "Initial commit"):
if "%msg%"=="" set msg=Initial commit
git commit -m "%msg%"
:: Create & switch to main branch (if not exists)
echo πͺ Setting up main branch...
git branch -M main
:: Add remote origin
echo π Linking remote repository...
git remote remove origin >nul 2>&1
git remote add origin %repoUrl%
:: Push to GitHub
echo π Pushing code to remote repo...
git push -u origin main
echo.
echo β
SUCCESS! Your repo has been pushed to GitHub, boss π
echo ======================================================
pause