gh repo fork
Fork someone else's repository
What it does
A fork is a copy of someone else's repository in your account: you can push to it and offer changes to the author through a pull request. gh repo fork owner/repository creates the fork on GitHub, and --clone clones it right away.
After cloning, origin points to your fork and upstream to the original. Run gh repo fork with no name inside a repository you have already cloned, and gh forks it and offers to add the fork as a remote.
Syntax
gh repo fork <owner>/<repository> --clone
gh repo forkExamples
Fork the repository anna/shop and clone the fork right away
gh repo fork anna/shop --clonerepo fork— a copy of someone else's repository in your accountanna/shop— what to fork--clone— and clone the fork
Related commands
- gh repo clone — Clone a GitHub repository by its short name
- gh pr create — Open a pull request from the current branch
- git remote — List and add remote repositories