done
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDone - Reset for next task
完成 - 为下一项任务重置环境
You are finishing up the current work and resetting the repo to be ready for the next task.
你已完成当前工作,现在将仓库重置为可开始下一项任务的状态。
Steps
步骤
-
Check for uncommitted changes: Run. If there is ANY output (staged, unstaged, or untracked files), stop immediately and tell the user:
git status --porcelain- List the uncommitted/untracked files
- Tell them to commit or stash their changes before running
/done - Do NOT proceed to the next steps
-
Determine the default branch: Runto check which exists. Prefer
git branch --list master mainif it exists, otherwise usemaster. If neither exists, tell the user that no master or main branch was found and stop.main -
Switch to the default branch: Runwhere
git checkout <branch>is the branch determined in step 2.<branch> -
Pull latest changes: Runto fetch and merge the latest changes from the remote.
git pull -
Confirm: Tell the user they are now on the default branch with the latest changes and ready to start the next task.
-
检查未提交的更改:运行。如果有任何输出(已暂存、未暂存或未跟踪的文件),立即停止并告知用户:
git status --porcelain- 列出未提交/未跟踪的文件
- 告知他们在运行之前提交或暂存更改
/done - 不要继续执行后续步骤
-
确定默认分支:运行检查哪个分支存在。如果
git branch --list master main存在则优先使用,否则使用master。如果两者都不存在,告知用户未找到master或main分支并停止操作。main -
切换到默认分支:运行,其中
git checkout <branch>是步骤2中确定的分支。<branch> -
拉取最新更改:运行从远程仓库获取并合并最新更改。
git pull -
确认:告知用户现在已处于默认分支且拥有最新更改,可以开始下一项任务了。