Some checks failed
Build and Deploy / test-backend (push) Has been cancelled
Build and Deploy / build-backend (push) Has been cancelled
Build and Deploy / build-admin (push) Has been cancelled
Deploy to Production / build-backend (push) Has been cancelled
Deploy to Production / deploy (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
105 lines
2.7 KiB
Markdown
105 lines
2.7 KiB
Markdown
# 私有仓库设置步骤(按顺序执行)
|
||
|
||
## ⚠️ 重要:必须先创建仓库才能推送
|
||
|
||
当前错误 `404 page not found` 表示仓库尚未创建。
|
||
|
||
## 📋 完整步骤
|
||
|
||
### 步骤 1:创建 Git 仓库(必须)
|
||
|
||
1. **打开浏览器**,访问:https://git.quanyu360.cn
|
||
|
||
2. **登录**:
|
||
- 用户名:`admin`
|
||
- 密码:`ye972030`
|
||
|
||
3. **创建新仓库**:
|
||
- 点击页面上的 **"New Repository"** 或 **"新建仓库"** 按钮
|
||
- 填写信息:
|
||
- **Repository Name(仓库名)**: `wecom-ai-assistant`
|
||
- **Owner(所有者)**: 选择 `admin`(如果可以选择)
|
||
- **Visibility(可见性)**: 选择 **Private(私有)**
|
||
- **初始化选项**:
|
||
- ❌ **不要**勾选 "Initialize this repository with a README"
|
||
- ❌ **不要**勾选 "Add .gitignore"
|
||
- ❌ **不要**勾选 "Choose a license"
|
||
- 点击 **"Create Repository"** 或 **"创建仓库"**
|
||
|
||
4. **复制仓库 URL**:
|
||
- 创建成功后,页面会显示仓库的 Git URL
|
||
- 格式类似:`https://git.quanyu360.cn/admin/wecom-ai-assistant.git`
|
||
- **复制这个 URL**
|
||
|
||
### 步骤 2:配置并推送代码
|
||
|
||
创建仓库后,在 PowerShell 中执行:
|
||
|
||
```powershell
|
||
# 1. 更新远程仓库 URL(使用创建后显示的实际 URL)
|
||
git remote remove private
|
||
git remote add private https://admin:ye972030@git.quanyu360.cn/admin/wecom-ai-assistant.git
|
||
|
||
# 2. 验证配置
|
||
git remote -v
|
||
|
||
# 3. 推送代码
|
||
git push -u private main
|
||
```
|
||
|
||
**注意**:如果创建后的实际 URL 不同,请替换上面的 URL。
|
||
|
||
### 步骤 3:验证推送成功
|
||
|
||
推送成功后,访问以下 URL 确认:
|
||
|
||
**仓库地址**: https://git.quanyu360.cn/admin/wecom-ai-assistant
|
||
|
||
应该能看到你的代码文件。
|
||
|
||
## 🔍 如果仍然失败
|
||
|
||
### 检查仓库路径
|
||
|
||
创建仓库后,Git 服务器会显示实际的 Git URL。请确认:
|
||
|
||
1. **命名空间是否正确**:
|
||
- 可能是 `/admin/wecom-ai-assistant.git`
|
||
- 可能是 `/wecom-ai-assistant.git`
|
||
- 可能是 `/root/wecom-ai-assistant.git`
|
||
- 或其他格式
|
||
|
||
2. **使用实际 URL**:
|
||
```powershell
|
||
# 替换为创建后显示的实际 URL
|
||
git remote set-url private https://admin:ye972030@实际URL
|
||
```
|
||
|
||
### 检查权限
|
||
|
||
确保:
|
||
- 用户名和密码正确
|
||
- 用户有创建和推送仓库的权限
|
||
|
||
## ✅ 完成后的状态
|
||
|
||
成功后,你应该有:
|
||
|
||
- ✅ Git 仓库:https://git.quanyu360.cn/admin/wecom-ai-assistant
|
||
- ✅ 代码已推送
|
||
- ✅ 可以正常使用 `git push private main` 推送更新
|
||
|
||
## 📝 日常使用
|
||
|
||
```powershell
|
||
# 推送到私有仓库(默认)
|
||
git push private main
|
||
|
||
# 推送到 GitHub
|
||
git push origin main
|
||
|
||
# 推送到两个仓库
|
||
git push private main
|
||
git push origin main
|
||
```
|