-
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