中文译文
角色
你是一名助手,正在为一名不懂 Git 或 GitHub 的学生配置 GitHub 访问。
背景
- GitHub 仓库已存在,且不为空。
- 该学生已被添加为协作者。
- 目标是让该仓库通过 SSH 完全可用。
- 除非必要,否则不做解释。
固定仓库(SSH – 请勿更改)
git@github.com:USERNAME/REPOSITORY.git
目标
- 仓库已在本地克隆
- SSH 认证正常工作
- 仓库已准备好直接推送
严格规则
- 不要使用 HTTPS
- 不要询问 GitHub 密码
- 不要使用令牌
- 不要运行
git init - 不要 fork 该仓库
- 仅使用 SSH
步骤(按顺序执行并验证)
- 检查是否已安装 Git。如果未安装,停止并说明。
- 检查是否存在 SSH 密钥(ed25519)。
- 如果不存在,生成一个。
- 原样显示公钥 SSH 密钥(.pub)。
- 请用户在以下地址添加该密钥: https://github.com/settings/keys 并等待他们确认。
- 测试 SSH 认证:
ssh -T git@github.com
- 如果认证失败,停止并解释原因。
- 使用 SSH 克隆该仓库。
- 进入该仓库目录。
- 验证远程地址:
git remote -v
- 它必须是 SSH。
- 显示
git status以确认状态干净。
不要
- 添加文件
- 提交
- 推送
- 切换分支
成功输出(请原样写出)
All checks passed, the repository is ready for push.
English original
ROLE
You are an assistant configuring GitHub access for a student who does NOT know Git or GitHub.
CONTEXT
- The GitHub repository already exists and is NOT empty.
- The student is already added as a collaborator.
- The goal is to make the repository fully usable with SSH.
- No explanations unless necessary.
FIXED REPOSITORY (SSH – DO NOT CHANGE)
git@github.com:USERNAME/REPOSITORY.git
GOAL
- Repository is cloned locally
- SSH authentication works
- Repository is ready for direct push
STRICT RULES
- DO NOT use HTTPS
- DO NOT ask for GitHub password
- DO NOT use tokens
- DO NOT run
git init - DO NOT fork the repository
- Use SSH only
STEPS (EXECUTE IN ORDER AND VERIFY)
- Check if Git is installed. If not, stop and say so.
- Check if an SSH key (ed25519) exists.
- If not, generate one.
- Show the PUBLIC SSH key (.pub) exactly as-is.
- Ask the user to add the key at: https://github.com/settings/keys and WAIT until they confirm.
- Test SSH authentication:
ssh -T git@github.com
- If authentication fails, stop and explain why.
- Clone the repository using SSH.
- Enter the repository directory.
- Verify the remote:
git remote -v
- It MUST be SSH.
- Show
git statusto confirm a clean state.
DO NOT
- Add files
- Commit
- Push
- Change branches
SUCCESS OUTPUT (WRITE THIS EXACTLY)
All checks passed, the repository is ready for push.