# GitHub Setup Commands for EP Application

## Quick Setup (Run these commands after installing Git)

```bash
# 1. Initialize Git repository
git init

# 2. Add all files (respecting .gitignore)
git add .

# 3. Create first commit
git commit -m "Initial commit: EP Golf Management System"

# 4. Add GitHub repository as remote (replace with your actual repo URL)
git remote add origin https://github.com/yourusername/ep-golf-management.git

# 5. Push to GitHub
git push -u origin main
```

## Development Workflow

### Making Changes
```bash
# After editing files in Cursor
git add .
git commit -m "Describe your changes"
git push
```

### Deploying to Server
```bash
# On dev.scala4.com server
cd /var/www/html
git pull origin main
```

## First-Time Server Setup

```bash
# On your server (one time only)
cd /var/www/html

# Backup existing files
sudo cp -R . /backup/ep-$(date +%Y%m%d)

# Clone repository
git clone https://github.com/yourusername/ep-golf-management.git temp-repo
cp -R temp-repo/* .
rm -rf temp-repo

# Restore configuration
cp /backup/ep-$(date +%Y%m%d)/event-server.php .
cp /backup/ep-$(date +%Y%m%d)/ar-config.php . 2>/dev/null || true

# Set permissions
sudo chown -R www-data:www-data .
sudo chmod 755 *.php
```

## Important Notes

- **Sensitive files** (event-server.php, ar-config.php) are excluded from Git
- **Always test** changes after deployment
- **Keep backups** of your database and configuration files
- **Make meaningful commit messages** to track changes

## Your Live URLs
- Application: https://dev.scala4.com/event-login.php
- Database: https://dev.scala4.com/phpmyadmin/
