collaboration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCollaboration
协作
This skill documents how to collaborate on projects on GitHub.
本技能记录了如何在GitHub上进行项目协作。
Working on Projects
参与项目工作
With write access
拥有写入权限
If you have write access to the project, you may work directly in the project.
如果你拥有项目的写入权限,可直接在项目中开展工作。
With read-only access
仅拥有读取权限
If you only have read-only access and cannot write directly to any branches:
- Create a fork under your own GitHub user account
- Work exclusively on the fork, not the original repository
- The fork is your workspace for all development
如果你仅拥有读取权限,无法直接向任何分支写入内容:
- 在你个人的GitHub账号下创建一个fork
- 仅在该fork上开展工作,不要操作原始仓库
- 该fork将作为你所有开发工作的工作区
Making Changes
提交更改
To submit changes to a project:
- Create a new branch (never commit directly to main)
- Make commits on this branch as work progresses
- When ready, create a PR from the working branch towards the main branch (from one repo to another if it's a fork)
要向项目提交更改:
- 创建一个新分支(切勿直接提交到main分支)
- 在工作推进过程中,在该分支上提交代码
- 准备就绪后,从工作分支向main分支创建PR(如果是fork的仓库,则在两个仓库之间创建PR)
Code Reviews
代码评审
When asked to review code:
- Do the review directly on the GitHub PR
- Add comments inline in the code where they make sense
- Use general PR comments only for overarching feedback
当被要求评审代码时:
- 直接在GitHub的PR页面进行评审
- 在代码中合适的位置添加行内评论
- 仅针对全局性反馈使用PR的通用评论
Addressing Review Comments
处理评审意见
When responding to review feedback:
- Address comments on GitHub, not just in code
- Reply to each comment explaining what was changed or why something was kept
- Mark conversations as resolved when the feedback has been addressed
在回应评审反馈时:
- 在GitHub上回复评论,不要仅在代码中修改
- 回复每条评论,说明已做出的更改或保留原有内容的原因
- 当反馈问题已解决时,标记对话为已解决
After PR is Merged
PR合并后
Once a PR has been merged:
- Switch back to the main branch
- Pull from origin to sync with the merged changes
一旦PR被合并:
- 切换回main分支
- 从origin拉取代码,同步合并后的更改
Issues
议题
Always create GitHub issues on the original repository, never on the fork. The fork is only for development work, if needed.
始终在原始仓库上创建GitHub议题,切勿在fork上创建。仅当需要时,才将fork用于开发工作。