Add GitHub setup helper script

This commit is contained in:
anas-rashid 2026-04-03 20:04:11 +02:00
parent d8fda9fe5d
commit 775ee17a7b

73
setup_github.sh Executable file
View File

@ -0,0 +1,73 @@
#!/bin/bash
# GitHub Setup Script for Quadratic Plotter Project
# This script helps you push this project to a private GitHub repository
set -e
echo "=========================================="
echo "GitHub Repository Setup for Quadratic Plotter"
echo "=========================================="
echo
# Check if git is installed
if ! command -v git &> /dev/null; then
echo "❌ Git is not installed. Please install git first."
exit 1
fi
# Check if we're in a git repository
if [ ! -d ".git" ]; then
echo "❌ Not a git repository. Initializing git..."
git init
git add .
git commit -m "Initial commit: Quadratic Equation Plotter"
fi
echo "✅ Git repository is ready"
echo
# Check for GitHub CLI
if command -v gh &> /dev/null; then
echo "✅ GitHub CLI (gh) is installed"
echo
echo "To create a private repository and push:"
echo " 1. Authenticate if not already: gh auth login"
echo " 2. Run: gh repo create quadratic-plotter --private --source=. --remote=origin --push"
echo
else
echo " GitHub CLI (gh) is not installed"
echo
echo "Manual setup instructions:"
echo " 1. Create a new private repository at https://github.com/new"
echo " - Name: quadratic-plotter (or your preferred name)"
echo " - Select 'Private'"
echo " - DO NOT initialize with README, .gitignore, or license"
echo
echo " 2. Add remote and push:"
echo " git remote add origin https://github.com/YOUR_USERNAME/quadratic-plotter.git"
echo " git branch -M main"
echo " git push -u origin main"
echo
echo " 3. For SSH (recommended for frequent pushes):"
echo " git remote add origin git@github.com:YOUR_USERNAME/quadratic-plotter.git"
echo " git branch -M main"
echo " git push -u origin main"
fi
echo "=========================================="
echo "Current Git Status:"
echo "=========================================="
git status
echo
echo "=========================================="
echo "Recent Commits:"
echo "=========================================="
git log --oneline -5
echo
echo "=========================================="
echo "Remote Repositories:"
echo "=========================================="
git remote -v
echo
echo "✅ Setup instructions complete!"
echo "👉 Follow the instructions above to push to GitHub"