Follow these steps to push your Healthcare Management System to GitHub and set up automatic deployments.
- Git installed on your computer
- GitHub account
- Your project files ready
Open your terminal in the project root directory and run:
# Navigate to your project directory
cd /path/to/HealthcareManagementSystem
# Initialize git repository
git init
# Add all files to staging
git add .
# Create initial commit
git commit -m "Initial commit: Healthcare Management System with modern UI"- Go to GitHub: Visit github.com and sign in
- New Repository: Click the "+" icon → "New repository"
- Repository Details:
- Name:
healthcare-management-system(or your preferred name) - Description:
Modern healthcare management system with invoice generation - Visibility: Choose Public or Private
- DO NOT initialize with README, .gitignore, or license (we already have these)
- Name:
- Create Repository: Click "Create repository"
Copy the repository URL from GitHub, then run:
# Add GitHub repository as remote origin
git remote add origin https://github.com/YOUR_USERNAME/healthcare-management-system.git
# Verify remote was added
git remote -v
# Push to GitHub
git push -u origin mainNote: Replace
YOUR_USERNAMEwith your actual GitHub username
- Go to your repository on GitHub
- Click Settings tab
- Click Branches in the left sidebar
- Click Add rule
- Configure:
- Branch name pattern:
main - Check Require pull request reviews before merging
- Check Require status checks to pass before merging
- Branch name pattern:
For automatic deployments to work, you need to add secrets to your GitHub repository:
- Login to Netlify: Go to netlify.com
- Personal Access Token:
- Go to User settings → Applications → Personal access tokens
- Generate new token → Copy it
- Site ID:
- Deploy your site manually first (see DEPLOYMENT.md)
- Go to Site settings → General → Site details
- Copy the Site ID
-
Go to your GitHub repository
-
Click Settings tab
-
Click Secrets and variables → Actions
-
Click New repository secret and add:
Name: NETLIFY_AUTH_TOKEN Value: [Your Netlify personal access token]Name: NETLIFY_SITE_ID Value: [Your Netlify site ID]Name: VITE_API_BASE_URL Value: https://your-backend-api.com/api
# Check status
git status
# Add changes
git add .
# Commit changes
git commit -m "Description of changes"
# Push to GitHub
git push# Create new branch
git checkout -b feature-name
# Switch branches
git checkout main
git checkout feature-name
# Merge branch to main
git checkout main
git merge feature-name
# Delete branch
git branch -d feature-name# Pull latest changes
git pull origin main
# View commit history
git log --oneline
# View remote repositories
git remote -vOnce set up, your workflow will be:
- Make Changes: Edit your code locally
- Commit & Push:
git add . git commit -m "Your commit message" git push
- Automatic Build: GitHub Actions will automatically:
- Build your frontend
- Deploy to Netlify
- Update your live site
Your GitHub repository will contain:
healthcare-management-system/
├── .github/
│ └── workflows/
│ └── deploy.yml # GitHub Actions workflow
├── backend/ # Backend API code
├── frontend/ # Frontend React code
├── .gitignore # Files to ignore
├── netlify.toml # Netlify configuration
├── README.md # Project documentation
├── DEPLOYMENT.md # Deployment instructions
├── GITHUB_SETUP.md # This file
├── LICENSE # MIT License
└── package.json # Root package.json
1. "Permission denied" error:
# Check if you're authenticated
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
# Use HTTPS with token or set up SSH keys2. "Remote already exists" error:
# Remove existing remote and add new one
git remote remove origin
git remote add origin https://github.com/YOUR_USERNAME/REPO_NAME.git3. "Branch 'main' doesn't exist" error:
# Create main branch
git branch -M main
git push -u origin main4. Merge conflicts:
# Pull latest changes first
git pull origin main
# Resolve conflicts in your editor
# Then commit the resolution
git add .
git commit -m "Resolve merge conflicts"
git pushAfter pushing to GitHub:
- Deploy Frontend: Follow the DEPLOYMENT.md guide to deploy to Netlify
- Deploy Backend: Choose a backend hosting service and deploy
- Update API URLs: Update environment variables with production URLs
- Test Everything: Ensure the deployed application works correctly
- Custom Domain: Set up a custom domain if desired
Happy coding! 🎉