git-fork-clone
Installation
SKILL.md
Git Fork & Clone
Fork 别人的 GitHub 仓库并 clone 到本地,自动配置 official remote。
触发条件
当用户要求 fork 别人的仓库并 clone 到本地时使用此 skill。
输入
用户需要提供目标仓库,格式为 owner/repo。
执行步骤
- Fork 仓库:使用
gh repo fork <owner/repo> --clone=false将仓库 fork 到zc277584121账号下。 - Clone 仓库:使用
gh repo clone zc277584121/<repo>将 fork 后的仓库 clone 到本地。 - 进入项目目录:
cd <repo>。 - 添加 official remote:
git remote add official https://github.com/<original-owner>/<repo>.git,用于跟踪上游仓库。 - 验证 remote 配置:
git remote -v,确认 origin 指向自己的 fork,official 指向原始仓库。
Related skills
More from zc277584121/mygitplugin
git-summarize-weekly
Summarize weekly GitHub contributions for writing weekly reports
150git-sync-main
Sync local main branch with the latest code from official upstream or origin remote
148git-create-repo
Create a new GitHub repository and clone it locally
148git-commit-push
Commit changes and push to origin without creating a PR
148git-commit-pr
Commit changes and create a pull request to the official upstream repo
147git-get-notification
Check GitHub notifications and recent Issues/PRs for monitored repos
146