feature: When cloning a fork, set remote name to username #471

sheerun opened this Issue Jan 26, 2014 · 5 comments

2 participants


It's useful in pull-request flows. For example when I fork rails, I want rails to be origin and my fork to be sheerun. My proposal is:

hub clone sheerun/rails

would detect if sheerun/rails is fork of rails/rails and add two remotes:

  • origin that is set to rails/rails
  • sheerun that is set to sheerun/rails

The master branch would remote track sheerun/rails

GitHub member

How about:

hub clone rails/rails
hub remote add sheerun

The thing is in this case master points to rails/rails, not sheerun/rails.

And it's one command too much :P

GitHub member

Your idea isn't too crazy, but I'm afraid that it might be surprising for some. Users expect that if they clone a repository directly, it will be referred to via the "origin" remote. Adding a detection whether the target repo is a fork and naming remotes differently would break that. Not sure if I want to risk pissing a lot of people off.


I don't really expect it to be the default. How about an opt-in with ~/.config/hub?


It would be nice if hub fork also respected this configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment