git
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit
Git
Use to inspect history, create branches, commit changes, and resolve conflicts.
git使用查看历史记录、创建分支、提交更改以及解决冲突。
gitCommon workflows
常见工作流程
- Check status:
git status - Create a branch:
git checkout -b my-branch - Stage + commit:
git add -A && git commit -m "message" - Rebase:
git rebase -i origin/main
- 查看状态:
git status - 创建分支:
git checkout -b my-branch - 暂存并提交:
git add -A && git commit -m "message" - 变基:
git rebase -i origin/main
GitHub Integration
GitHub集成
After making local commits with git, use the GitHub tools to push your work upstream and open pull requests:
- Create a remote branch — Use to create a branch on the remote from a given SHA. Get the SHA from your local HEAD with
github_branch_create, then create the matching remote branch.git rev-parse HEAD - Open a pull request — Use to open a PR from your feature branch to the default branch, with a clear title and description summarizing the changes.
github_pr_create - Full GitHub API operations — The skill provides 26 tools covering PR review, merge, issue triage, release management, Actions CI/CD, and more. Reference it for anything beyond local git operations.
github
Division of responsibility: Use for local operations (staging, committing, branching, rebasing, diffing, log inspection) and the tools for remote API operations (creating PRs, reviewing code, managing issues, triggering workflows). The two complement each other — git handles your local working copy while the GitHub tools interact with the hosted platform.
gitgithub_*使用git完成本地提交后,可借助GitHub工具将工作推送到上游仓库并发起拉取请求:
- 创建远程分支 — 使用从指定SHA在远程端创建分支。通过
github_branch_create获取本地HEAD的SHA,然后创建对应的远程分支。git rev-parse HEAD - 发起拉取请求 — 使用从功能分支向默认分支发起PR,附上清晰的标题和描述以总结变更内容。
github_pr_create - 完整GitHub API操作 — 技能提供26种工具,涵盖PR评审、合并、问题分类、发布管理、Actions CI/CD等功能。超出本地git操作的需求均可参考该技能。
github
职责划分: 使用进行本地操作(暂存、提交、分支创建、变基、差异对比、日志查看),使用工具进行远程API操作(创建PR、代码评审、问题管理、触发工作流)。两者相辅相成——git处理本地工作副本,GitHub工具则与托管平台交互。
gitgithub_*