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 fr
  • hub(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