Files
wecom-ai-assistant/CREATE_REPO_GUIDE.md
bujie9527 27a794eef1 Add repository creation guide
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-05 20:14:41 +08:00

2.5 KiB
Raw Permalink Blame History

创建私有仓库并推送代码指南

步骤 1在 Git 服务器上创建仓库

访问 Git 服务器

  1. 打开浏览器,访问:https://git.quanyu360.cn
  2. 使用以下凭据登录:
    • 用户名: admin
    • 密码: ye972030

创建新仓库

  1. 登录后,点击 "New Repository""新建仓库" 按钮
  2. 填写仓库信息:
    • 仓库名称: wecom-ai-assistant
    • 命名空间/组织: admin(如果可以选择)
    • 可见性: 选择 Private私有
    • 初始化选项:
      • 不要勾选 "Initialize repository with a README"
      • 不要勾选 "Add .gitignore"
      • 不要勾选 "Choose a license"
  3. 点击 "Create Repository""创建仓库"

步骤 2推送代码到私有仓库

创建仓库后,运行以下命令推送代码:

# 确保远程仓库已配置
git remote remove private 2>$null
git remote add private https://admin:ye972030@git.quanyu360.cn/admin/wecom-ai-assistant.git

# 推送代码
git push -u private main

一键脚本

如果仓库已创建,可以直接运行:

.\scripts\push-to-private-repo.ps1

验证

推送成功后,访问以下 URL 验证:

仓库地址: https://git.quanyu360.cn/admin/wecom-ai-assistant

故障排查

问题:推送时提示 "repository not found"

原因: 仓库尚未创建

解决方案:

  1. 按照上面的步骤 1 手动创建仓库
  2. 然后重新推送

问题:推送时提示认证失败

解决方案:

# 更新远程 URL包含凭据
git remote set-url private https://admin:ye972030@git.quanyu360.cn/admin/wecom-ai-assistant.git

# 重新推送
git push -u private main

问题:仓库路径不正确

如果仓库路径不是 /admin/wecom-ai-assistant,请更新:

# 查看实际仓库 URL在 Git 服务器上创建后可以看到)
# 然后更新远程 URL
git remote set-url private https://admin:ye972030@git.quanyu360.cn/实际路径/wecom-ai-assistant.git

完成后的配置

推送成功后,你的项目将有两个远程仓库:

日常使用

# 推送到私有仓库(默认)
git push private main

# 推送到 GitHub
git push origin main

# 推送到两个仓库
git push private main
git push origin main