Skip to content

Commit 697f45e

Browse files
committed
Add push automation scripts and guides
1 parent 157270b commit 697f45e

File tree

2 files changed

+210
-0
lines changed

2 files changed

+210
-0
lines changed

PUSH_GUIDE.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# 🚀 GitHub 推送指南
2+
3+
## 当前状态
4+
- ✅ Git 仓库已初始化
5+
- ✅ 所有文件已提交
6+
- ✅ Git 用户配置: chenjingxiong (chenjingxiong@gmail.com)
7+
8+
## 📋 推送步骤
9+
10+
### 步骤 1: 创建 GitHub 仓库
11+
12+
浏览器已自动打开 https://github.com/new
13+
14+
请在浏览器中完成以下操作:
15+
16+
1. **登录 GitHub**(如果尚未登录)
17+
18+
2. **填写仓库信息**
19+
- Repository name: `AI_Coder_AllInOne`
20+
- Description: `🚀 Unified Docker environment with VSCode Server, Claude Code, Vibe-Kanban, OpenCode/Sisyphus, and more AI coding tools`
21+
- 选择: **Public** (公开仓库)
22+
23+
3. **不要勾选以下选项**
24+
- ❌ Add a README file
25+
- ❌ Add .gitignore
26+
- ❌ Choose a license
27+
28+
4. **点击 "Create repository" 按钮**
29+
30+
### 步骤 2: 推送代码
31+
32+
创建仓库后,在 PowerShell 中运行以下命令(将 `YOUR_USERNAME` 替换为您的 GitHub 用户名):
33+
34+
```powershell
35+
# 进入项目目录
36+
cd "d:\Quant_Code\MyProject\VSCode_Server-OpenCode-OhMyOpenCode_Docker-Vibekanban-ClaudCode-KiloCode-ByAntigravity"
37+
38+
# 添加远程仓库(替换 YOUR_USERNAME)
39+
git remote add origin https://github.com/YOUR_USERNAME/AI_Coder_AllInOne.git
40+
41+
# 重命名分支为 main
42+
git branch -M main
43+
44+
# 推送到 GitHub
45+
git push -u origin main
46+
```
47+
48+
### 步骤 3: 启用 GitHub Actions
49+
50+
推送成功后:
51+
52+
1. 访问您的仓库: `https://github.com/YOUR_USERNAME/AI_Coder_AllInOne`
53+
2. 进入 **Settings****Actions****General**
54+
3. 在 "Workflow permissions" 下选择:
55+
-**Read and write permissions**
56+
-**Allow GitHub Actions to create and approve pull requests**
57+
4. 点击 **Save**
58+
59+
### 步骤 4: 等待自动构建
60+
61+
1. 点击仓库的 **Actions** 标签页
62+
2. 查看 "Docker Build and Push" 工作流
63+
3. 等待构建完成(约 10-15 分钟)
64+
65+
### 步骤 5: 更新 README 徽章
66+
67+
构建完成后,编辑 `README.md`,将所有 `YOUR_USERNAME` 替换为您的实际 GitHub 用户名。
68+
69+
## 🐳 使用已发布的镜像
70+
71+
构建完成后,任何人都可以使用:
72+
73+
```bash
74+
docker pull ghcr.io/YOUR_USERNAME/ai_coder_allinone:latest
75+
docker run -d -p 8080:8080 ghcr.io/YOUR_USERNAME/ai_coder_allinone:latest
76+
```
77+
78+
访问: http://localhost:8080
79+
80+
## 🎯 快速命令(复制粘贴)
81+
82+
假设您的 GitHub 用户名是 `chenjingxiong`
83+
84+
```powershell
85+
git remote add origin https://github.com/chenjingxiong/AI_Coder_AllInOne.git
86+
git branch -M main
87+
git push -u origin main
88+
```
89+
90+
---
91+
92+
**准备好了吗?开始推送吧!** 🚀

auto-push-github.ps1

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#!/usr/bin/env pwsh
2+
# 自动推送到 GitHub 的完整脚本
3+
4+
Write-Host "🚀 AI Coder All-in-One - 自动推送到 GitHub" -ForegroundColor Cyan
5+
Write-Host "=========================================" -ForegroundColor Cyan
6+
Write-Host ""
7+
8+
# 步骤 1: 检查 Git 配置
9+
Write-Host "📝 步骤 1/5: 检查 Git 配置..." -ForegroundColor Yellow
10+
$gitUser = git config user.name
11+
$gitEmail = git config user.email
12+
13+
if ([string]::IsNullOrWhiteSpace($gitUser) -or [string]::IsNullOrWhiteSpace($gitEmail)) {
14+
Write-Host "⚠️ Git 用户信息未配置" -ForegroundColor Yellow
15+
$userName = Read-Host "请输入您的 Git 用户名"
16+
$userEmail = Read-Host "请输入您的 Git 邮箱"
17+
18+
git config --global user.name "$userName"
19+
git config --global user.email "$userEmail"
20+
Write-Host "✅ Git 配置已更新" -ForegroundColor Green
21+
}
22+
else {
23+
Write-Host "✅ Git 用户: $gitUser ($gitEmail)" -ForegroundColor Green
24+
}
25+
26+
Write-Host ""
27+
28+
# 步骤 2: 打开浏览器创建仓库
29+
Write-Host "📝 步骤 2/5: 创建 GitHub 仓库..." -ForegroundColor Yellow
30+
Write-Host "正在打开浏览器..." -ForegroundColor Cyan
31+
Start-Process "https://github.com/new"
32+
33+
Write-Host ""
34+
Write-Host "请在浏览器中完成以下操作:" -ForegroundColor Yellow
35+
Write-Host "1. 登录 GitHub(如果尚未登录)" -ForegroundColor White
36+
Write-Host "2. Repository name: AI_Coder_AllInOne" -ForegroundColor White
37+
Write-Host "3. Description: 🚀 Unified Docker environment with VSCode Server, Claude Code, Vibe-Kanban, OpenCode/Sisyphus, and more AI coding tools" -ForegroundColor White
38+
Write-Host "4. 选择 'Public' 公开仓库" -ForegroundColor White
39+
Write-Host "5. 不要勾选 'Add a README file'" -ForegroundColor White
40+
Write-Host "6. 不要勾选 'Add .gitignore'" -ForegroundColor White
41+
Write-Host "7. 不要选择 'Choose a license'" -ForegroundColor White
42+
Write-Host "8. 点击 'Create repository' 按钮" -ForegroundColor White
43+
Write-Host ""
44+
45+
$confirm = Read-Host "完成后,请输入您的 GitHub 用户名"
46+
47+
if ([string]::IsNullOrWhiteSpace($confirm)) {
48+
Write-Host "❌ 未输入用户名,脚本终止" -ForegroundColor Red
49+
exit 1
50+
}
51+
52+
$GITHUB_USERNAME = $confirm
53+
Write-Host "✅ GitHub 用户名: $GITHUB_USERNAME" -ForegroundColor Green
54+
Write-Host ""
55+
56+
# 步骤 3: 配置远程仓库
57+
Write-Host "📝 步骤 3/5: 配置远程仓库..." -ForegroundColor Yellow
58+
git remote remove origin 2>$null
59+
git remote add origin "https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne.git"
60+
Write-Host "✅ 远程仓库已配置: https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne.git" -ForegroundColor Green
61+
Write-Host ""
62+
63+
# 步骤 4: 重命名分支
64+
Write-Host "📝 步骤 4/5: 重命名分支为 main..." -ForegroundColor Yellow
65+
git branch -M main
66+
Write-Host "✅ 分支已重命名为 main" -ForegroundColor Green
67+
Write-Host ""
68+
69+
# 步骤 5: 推送到 GitHub
70+
Write-Host "📝 步骤 5/5: 推送代码到 GitHub..." -ForegroundColor Yellow
71+
Write-Host "正在推送..." -ForegroundColor Cyan
72+
Write-Host ""
73+
74+
git push -u origin main
75+
76+
if ($LASTEXITCODE -eq 0) {
77+
Write-Host ""
78+
Write-Host "🎉 成功推送到 GitHub!" -ForegroundColor Green
79+
Write-Host ""
80+
Write-Host "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Cyan
81+
Write-Host "📦 下一步操作:" -ForegroundColor Cyan
82+
Write-Host "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Cyan
83+
Write-Host ""
84+
Write-Host "1️⃣ 访问您的仓库:" -ForegroundColor Yellow
85+
Write-Host " https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne" -ForegroundColor White
86+
Write-Host ""
87+
Write-Host "2️⃣ 启用 GitHub Actions:" -ForegroundColor Yellow
88+
Write-Host " - 进入仓库 Settings → Actions → General" -ForegroundColor White
89+
Write-Host " - 选择 'Read and write permissions'" -ForegroundColor White
90+
Write-Host " - 点击 Save" -ForegroundColor White
91+
Write-Host ""
92+
Write-Host "3️⃣ 等待 Docker 镜像构建:" -ForegroundColor Yellow
93+
Write-Host " - 查看 Actions 标签页" -ForegroundColor White
94+
Write-Host " - 等待构建完成(约 10-15 分钟)" -ForegroundColor White
95+
Write-Host ""
96+
Write-Host "4️⃣ 更新 README 徽章:" -ForegroundColor Yellow
97+
Write-Host " - 将 README.md 中的 YOUR_USERNAME 替换为 $GITHUB_USERNAME" -ForegroundColor White
98+
Write-Host ""
99+
Write-Host "🐳 构建完成后,镜像地址:" -ForegroundColor Cyan
100+
Write-Host " ghcr.io/$GITHUB_USERNAME/ai_coder_allinone:latest" -ForegroundColor White
101+
Write-Host ""
102+
Write-Host "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Cyan
103+
104+
# 自动打开仓库页面
105+
Start-Process "https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne"
106+
107+
}
108+
else {
109+
Write-Host ""
110+
Write-Host "❌ 推送失败!" -ForegroundColor Red
111+
Write-Host ""
112+
Write-Host "可能的原因:" -ForegroundColor Yellow
113+
Write-Host "1. 仓库尚未创建" -ForegroundColor White
114+
Write-Host "2. 没有推送权限" -ForegroundColor White
115+
Write-Host "3. 需要进行身份验证" -ForegroundColor White
116+
Write-Host ""
117+
Write-Host "请检查并重试" -ForegroundColor Yellow
118+
}

0 commit comments

Comments
 (0)