This automates the standard fork and clone workflow for contributing to GitHub projects. It forks a repo to your account, clones it locally, and sets up two remotes: origin pointing to your fork and official (not upstream) pointing to the original repo. The workflow is opinionated about the remote naming convention, which is slightly non-standard but consistently applied. Saves you from manually running four or five commands every time you want to work on someone else's project. Uses GitHub CLI under the hood, so you'll need gh authenticated. If you fork repos regularly, this eliminates the repetitive setup.

skills.sh installs
3.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add zc277584121/mygitplugin --skill git-fork-clone --agent claude-code

Installs into .claude/skills of the current project.

Files

Git Fork & Clone

Fork 别人的 GitHub 仓库并 clone 到本地,自动配置 official remote。

触发条件

当用户要求 fork 别人的仓库并 clone 到本地时使用此 skill。

输入

用户需要提供目标仓库,格式为 owner/repo。

执行步骤

  1. Fork 仓库:使用 gh repo fork <owner/repo> --clone=false 将仓库 fork 到 zc277584121 账号下。
  2. Clone 仓库:使用 gh repo clone zc277584121/<repo> 将 fork 后的仓库 clone 到本地。
  3. 进入项目目录:cd <repo>。
  4. 添加 official remote:git remote add official https://github.com/<original-owner>/<repo>.git,用于跟踪上游仓库。
  5. 验证 remote 配置:git remote -v,确认 origin 指向自己的 fork,official 指向原始仓库。

注意事项

  • 如果 fork 已存在,gh repo fork 会自动跳过 fork 步骤。
  • 始终使用 official 作为上游 remote 名称(而非 upstream),以保持一致性。
  • Clone 完成后向用户报告 remote 配置结果。

Sponsors

Details

Repository
github.com/zc277584121/mygitplugin
Category
Git & Pull Requests
First seen
Jun 3, 2026

More from zc277584121/mygitplugin

All 7
1zc277584121 avatargit-summarize-weeklyzc277584121/mygitpluginSummarize weekly GitHub contributions for writing weekly reports3.4Kskills.sh installs
2zc277584121 avatargit-sync-mainzc277584121/mygitpluginSync local main branch with the latest code from official upstream or origin remote3.4Kskills.sh installs
3getsentry avatarsentry-code-reviewgetsentry/sentry-for-aiAnalyze and resolve Sentry comments on GitHub Pull Requests. Use this when asked to review or fix issues identified by Sentry in PR comments. Can review specifi2.5Kskills.sh installs
4modem-dev avatarhunk-reviewmodem-dev/hunkInteracts with live Hunk diff review sessions via CLI. Inspects review focus, navigates files and hunks, reloads session contents, and adds inline review commen2.4Kskills.sh installs
5cursor avatarget-pr-commentscursor/pluginsFetch and summarize review comments from the active pull request2.3Kskills.sh installs
6langgenius avatarbackend-code-reviewlanggenius/difyUse only when the user explicitly requests a review or audit of backend code under `api/`. Supports pending-change, file-focused, and pasted-diff reviews. Do no2.1Kskills.sh installs