done

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Done - Reset for next task

完成 - 为下一项任务重置环境

You are finishing up the current work and resetting the repo to be ready for the next task.
你已完成当前工作,现在将仓库重置为可开始下一项任务的状态。

Steps

步骤

  1. Check for uncommitted changes: Run
    git status --porcelain
    . If there is ANY output (staged, unstaged, or untracked files), stop immediately and tell the user:
    • List the uncommitted/untracked files
    • Tell them to commit or stash their changes before running
      /done
    • Do NOT proceed to the next steps
  2. Determine the default branch: Run
    git branch --list master main
    to check which exists. Prefer
    master
    if it exists, otherwise use
    main
    . If neither exists, tell the user that no master or main branch was found and stop.
  3. Switch to the default branch: Run
    git checkout <branch>
    where
    <branch>
    is the branch determined in step 2.
  4. Pull latest changes: Run
    git pull
    to fetch and merge the latest changes from the remote.
  5. Confirm: Tell the user they are now on the default branch with the latest changes and ready to start the next task.
  1. 检查未提交的更改:运行
    git status --porcelain
    。如果有任何输出(已暂存、未暂存或未跟踪的文件),立即停止并告知用户:
    • 列出未提交/未跟踪的文件
    • 告知他们在运行
      /done
      之前提交或暂存更改
    • 不要继续执行后续步骤
  2. 确定默认分支:运行
    git branch --list master main
    检查哪个分支存在。如果
    master
    存在则优先使用,否则使用
    main
    。如果两者都不存在,告知用户未找到master或main分支并停止操作。
  3. 切换到默认分支:运行
    git checkout <branch>
    ,其中
    <branch>
    是步骤2中确定的分支。
  4. 拉取最新更改:运行
    git pull
    从远程仓库获取并合并最新更改。
  5. 确认:告知用户现在已处于默认分支且拥有最新更改,可以开始下一项任务了。