
Git Fork Clone
Fork someone else’s GitHub repo into your account and clone it with origin plus an official upstream remote in one guided flow.
Overview
git-fork-clone is an agent skill for the Build phase that forks a GitHub repo and clones it locally with origin and official remotes configured via gh.
Install
npx skills add https://github.com/zc277584121/mygitplugin --skill git-fork-cloneWhat is this skill?
- Fork with gh repo fork owner/repo --clone=false then clone from your fork
- Adds official remote pointing at the original upstream (not named upstream)
- Verifies git remote -v so origin is your fork and official is upstream
- Skips duplicate fork if gh reports the fork already exists
- Expects user input as owner/repo for the target repository
- Five-step workflow: fork, clone, cd, add official remote, verify remotes
Adoption & trust: 381 installs on skills.sh; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want to work from your own fork of someone else’s GitHub repo but need correct gh fork, clone, and upstream remote setup without mistakes.
Who is it for?
Indie devs using gh who regularly fork open-source repos before patches or experiments.
Skip if: Pure git remote work without GitHub, monorepos that do not use owner/repo forks, or teams that standardize on upstream as the remote name instead of official.
When should I use this skill?
When the user asks to fork someone else’s repository and clone it locally, providing target as owner/repo.
What do I get? / Deliverables
You have a local clone with origin on your fork and official tracking the original repository, confirmed by git remote -v.
- Local clone of your fork
- git remotes with origin (fork) and official (upstream)
Recommended Skills
Journey fit
Build is where you pull third-party code into your workspace before you customize or ship; fork-and-clone is a pre-implementation git setup step. Integrations covers wiring external repos and remotes into your local environment via GitHub CLI.
How it compares
Opinionated gh fork-and-clone recipe—not a full GitHub PR or sync-from-upstream maintenance skill.
Common Questions / FAQ
Who is git-fork-clone for?
Solo builders on GitHub CLI who need a repeatable fork, clone, and dual-remote setup before coding on a forked codebase.
When should I use git-fork-clone?
At the start of Build when you ask to fork another user’s repository and clone it locally with upstream tracking under the official remote name.
Is git-fork-clone safe to install?
The skill runs gh and git against your GitHub account; review the Security Audits panel on this Prism page and confirm fork targets before executing Bash steps.
SKILL.md
READMESKILL.md - Git Fork Clone
# 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 配置结果。