#!/bin/bash # Setup script to add GitHub remote and configure dual-push set -e echo "🔗 Setting up GitHub remote and dual-push configuration..." echo "" # Check if GitHub URL is provided if [ -z "$1" ]; then echo "Usage: ./setup_github_sync.sh " echo "Example: ./setup_github_sync.sh https://github.com/username/NeuroSAM3.git" exit 1 fi GITHUB_URL=$1 # Add GitHub remote echo "📦 Adding GitHub remote..." git remote add github "$GITHUB_URL" 2>/dev/null || git remote set-url github "$GITHUB_URL" echo "✅ GitHub remote added: $GITHUB_URL" # Show current remotes echo "" echo "📋 Current remotes:" git remote -v # Create git hook for automatic dual-push (optional) echo "" echo "💡 To push to both remotes automatically, use:" echo " git push origin main && git push github main" echo "" echo " Or set up an alias:" echo " git config alias.pushall '!git push origin main && git push github main'" echo " Then use: git pushall" echo "" echo "✅ Setup complete!" echo "" echo "📝 Next steps:" echo " 1. Push to GitHub: git push github main" echo " 2. Set up GitHub Actions secret:" echo " - Go to: https://github.com/YOUR_USERNAME/NeuroSAM3/settings/secrets/actions" echo " - Add secret: HF_TOKEN = your_huggingface_token" echo " 3. GitHub Actions will automatically sync to Hugging Face on every push"