46 lines
978 B
Bash
Executable File
46 lines
978 B
Bash
Executable File
#!/bin/bash
|
|
# Local Git Commit Script
|
|
# This script commits all changes locally without pushing to GitHub
|
|
|
|
cd /media/pts/Website/SkyArtShop
|
|
|
|
echo "========================================="
|
|
echo " Local Git Commit (No GitHub Sync)"
|
|
echo "========================================="
|
|
echo ""
|
|
|
|
# Show current changes
|
|
echo "Current changes:"
|
|
git status --short
|
|
echo ""
|
|
|
|
# Ask for commit message
|
|
read -p "Enter commit message: " commit_msg
|
|
|
|
if [ -z "$commit_msg" ]; then
|
|
echo "Error: Commit message cannot be empty"
|
|
exit 1
|
|
fi
|
|
|
|
# Stage all changes
|
|
echo "Staging all changes..."
|
|
git add -A
|
|
|
|
# Commit
|
|
echo "Committing changes..."
|
|
git commit -m "$commit_msg"
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo ""
|
|
echo "✅ Changes committed successfully!"
|
|
echo "📁 All changes are stored locally on this server"
|
|
echo "🚫 No changes will be pushed to GitHub"
|
|
echo ""
|
|
echo "Recent commits:"
|
|
git log --oneline -3
|
|
else
|
|
echo ""
|
|
echo "❌ Commit failed"
|
|
exit 1
|
|
fi
|