quadratic-plotter/setup_github.sh
2026-04-03 20:04:11 +02:00

73 lines
2.3 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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"