-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush_to_github.sh
More file actions
119 lines (103 loc) · 3.64 KB
/
push_to_github.sh
File metadata and controls
119 lines (103 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
echo "╔══════════════════════════════════════════════════════════╗"
echo "║ GitHub Push Script - Lead Generation Bot ║"
echo "╚══════════════════════════════════════════════════════════╝"
echo ""
# Check if git is installed
if ! command -v git &> /dev/null; then
echo "❌ Git is not installed!"
echo "Install from: https://git-scm.com/downloads"
exit 1
fi
echo "✅ Git is installed"
echo ""
# Check if already initialized
if [ -d ".git" ]; then
echo "📦 Git repository already initialized"
else
echo "📦 Initializing git repository..."
git init
echo "✅ Git initialized"
fi
echo ""
echo "📝 Adding files to git..."
git add .
echo "✅ Files added"
echo ""
echo "💾 Creating commit..."
git commit -m "Initial commit - Premium Lead Generation System"
echo "✅ Commit created"
echo ""
echo "🔗 Setting up GitHub remote..."
echo ""
echo "⚠️ IMPORTANT: First create a repository on GitHub!"
echo " 1. Go to: https://github.com/new"
echo " 2. Name: lead-generation-bot"
echo " 3. Keep it PRIVATE"
echo " 4. Don't initialize with README"
echo " 5. Click 'Create Repository'"
echo ""
read -p "Have you created the repository? (yes/no): " created
if [ "$created" != "yes" ]; then
echo ""
echo "❌ Please create the repository first, then run this script again"
exit 1
fi
echo ""
read -p "Enter your GitHub username: " username
if [ -z "$username" ]; then
echo "❌ Username cannot be empty!"
exit 1
fi
echo ""
echo "🔗 Adding remote..."
git remote remove origin 2>/dev/null
git remote add origin "https://github.com/$username/lead-generation-bot.git"
echo "✅ Remote added"
echo ""
echo "🌿 Setting branch to main..."
git branch -M main
echo "✅ Branch set"
echo ""
echo "⬆️ Pushing to GitHub..."
echo ""
echo "⚠️ You'll need to enter your GitHub credentials:"
echo " Username: $username"
echo " Password: Use Personal Access Token (not regular password)"
echo ""
echo " Get token from: https://github.com/settings/tokens"
echo ""
git push -u origin main
if [ $? -eq 0 ]; then
echo ""
echo "╔══════════════════════════════════════════════════════════╗"
echo "║ ✅ SUCCESS! ║"
echo "╚══════════════════════════════════════════════════════════╝"
echo ""
echo "🎉 Code pushed to GitHub successfully!"
echo ""
echo "📍 Your repository:"
echo " https://github.com/$username/lead-generation-bot"
echo ""
echo "🚀 Next steps:"
echo " 1. Go to: https://render.com"
echo " 2. Sign up with GitHub"
echo " 3. Create new Web Service"
echo " 4. Connect your repository"
echo " 5. Add environment variables"
echo " 6. Deploy!"
echo ""
echo "📖 See DEPLOY_ONLINE.md for detailed instructions"
else
echo ""
echo "❌ Push failed!"
echo ""
echo "Common issues:"
echo " 1. Wrong username/password"
echo " 2. Use Personal Access Token instead of password"
echo " 3. Repository not created on GitHub"
echo " 4. Internet connection issue"
echo ""
echo "Get Personal Access Token:"
echo " https://github.com/settings/tokens"
fi