Back to Skills

git-fork-clone

Fork a GitHub repo and clone it locally with proper remote setup

Updated 7/14/2026

Security Assessment

Safe(100/100)
Security Score100/100

About git-fork-clone

git-fork-clone forks a GitHub repository and clones it locally with a proper remote setup. It solves the routine but error-prone task of forking someone else's repo and configuring the local remotes consistently so the upstream repository can be tracked. It triggers when the user asks to fork another person's repo and clone it locally, and it expects the target repository as input in owner/repo format.

The skill follows a fixed procedure. It forks the repository with gh repo fork <owner/repo> --clone=false into the zc277584121 account, then clones the fork locally with gh repo clone zc277584121/<repo>, changes into the project directory with cd <repo>, adds the upstream remote using git remote add official https://github.com/<original-owner>/<repo>.git, and verifies the configuration with git remote -v to confirm that origin points to the user's fork and official points to the original repository. If the fork already exists, gh repo fork automatically skips the fork step.

It targets developers who contribute to upstream open-source projects and want a repeatable fork-and-clone flow. A key convention is that it always uses official (rather than upstream) as the name for the upstream remote to maintain consistency. After cloning completes, it reports the resulting remote configuration to the user. Because it relies on gh, the GitHub CLI must be available and authenticated.

FAQ

What input does the skill need?

The target repository in owner/repo format. It forks that repo into the zc277584121 account and clones the fork locally.

What remote naming convention does it use?

It always uses official (not upstream) as the name for the upstream remote, for consistency. After setup, origin points to your fork and official points to the original repository, verified with git remote -v.

What happens if the fork already exists?

gh repo fork automatically skips the fork step, so the procedure continues with cloning and remote configuration.

What are the prerequisites?

The gh (GitHub CLI) must be available and authenticated, since the skill uses gh repo fork and gh repo clone. Once cloning completes it reports the remote configuration to the user.

Install git-fork-clone

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill