hub-fork(1)
π hub-fork β fork the current repo on GitHub & add a git remote for it
okay so imagine this: you're sitting in a repo, you hit a button, and boom β there's a fork of it on GitHub with your name on it, and a shiny new git remote pointing at it. that's hub-fork, bestie. it's giving "clone but make it yours." β¨
this is part of the hub manual, and it's genuinely one of the comfiest commands in the whole set. no cap.
πΈ SYNOPSIS πΈ
hub fork [--no-remote] [--remote-name REMOTE] [--org ORGANIZATION]
three optional flags, zero required args. she's low maintenance. π
β¨ OPTIONS β¨
--no-remoteβ skip adding a git remote for the fork. like, fork it on GitHub but don't wire anything up locally. you do you, icon. π--remote-name REMOTEβ set the name for the new git remote. so instead of whatever default name it'd pick, you pick. main character energy. π--org ORGANIZATIONβ fork the repository within this organization. instead of it landing on your personal account, it goes into the org you name. very "we're doing this as a team" of you. π«Ά
π EXAMPLES π
the classic. just fork it, let it do its thing, remote gets added under USER:
$ hub fork
[ repo forked on GitHub ]
> git remote add -f USER git@github.com:USER/REPO.git
and here's the --org glow-up β fork lands in ORGANIZATION and the remote is named ORGANIZATION too:
$ hub fork --org=ORGANIZATION
[ repo forked on GitHub into the ORGANIZATION organization]
> git remote add -f ORGANIZATION git@github.com:ORGANIZATION/REPO.git
see how the remote name just follows along? cute. consistent. obsessed. π¦
ngl, those bracketed lines are literally the output hub prints at you, and the > lines are the git commands it runs for you. keep them exactly as-is if you're copying anything. π
π§ SEE ALSO π§
hub-clone(1)β the starter-pack sibling, go read it next fr frhub(1)β the main event, the mothership, the whole vibe π
and that's the page!! written by the hub girlies, version 2.14.2, dated 07 Jan 2024. mwah π go fork something iconic. πΈβ
π¦ where this page comes from
- opensuse-leap 16.0: hub 2.14.2-bp160.1.13 Β· MIT
- opensuse-leap 16.0: hub 2.14.2-bp160.1.13 Β· MIT
- opensuse-leap 16.0: hub 2.14.2-bp160.1.13 Β· MIT
- opensuse-leap 16.0: hub 2.14.2-bp160.1.13 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms