Fork someone else's GitHub repository and clone it locally, automatically configuring the official remote.
Trigger conditions
Use this skill when the user requests to fork someone else's repository and clone it locally.
Input
The user needs to provide the target repository, in the format owner/repo。
Execution steps
- Fork the repository: Use
gh repo fork <owner/repo> --clone=falseto fork the repository to thezc277584121account. - Clone the repository: Use
gh repo clone zc277584121/<repo>to clone the forked repository locally. - Enter the project directory:
cd <repo>。 - Add the official remote:
git remote add official https://github.com/<original-owner>/<repo>.git, used to track the upstream repository. - Verify the remote configuration:
git remote -v, confirming that origin points to your own fork and official points to the original repository.
Notes
- If the fork already exists,
gh repo forkwill automatically skip the fork step. - Always use
officialas the upstream remote name (rather thanupstream), to maintain consistency. - After cloning is complete, report the remote configuration result to the user.