0

Is it possible to submit a pull request if I originally cloned a repo locally rather than using the GitHub "fork" functionality??

The scenario is that I have created a local clone of a repository and made some changes. I would like to submit these back via pull request. I can create a repo on GitHub and push my changes there. Once I do that, will I be able to use the "new pull request" functionality, or will GitHub be unable to recognise that the repo is equivalent to a fork?

Tulains Córdova
39.6k13 gold badges102 silver badges157 bronze badges
asked Mar 17, 2017 at 10:54
2
  • 3
    see Where does my tool question go? Commented Mar 17, 2017 at 10:55
  • Why not fork and then push the changes? Creating a separate repository just wastes your (and GitHub) bandwidth as well as (probably) storage space (forking could use hard links) Commented Mar 17, 2017 at 19:01

1 Answer 1

2

It doesn't matter when you create the fork because of the distributed nature of git, but github needs a fork in order to make the association necessary to create a pull request, and it also lets people searching your profile more easily make the association back to the original project. Without the fork, you break a lot of very helpful links.

In my local workspace, I usually like to set up one remote called upstream to more easily pull from the original, then have origin point to my fork. After you create a fork, you can use the instructions here to change your origin remote url, then just push to there like normal. That way you won't lose any of your existing history.

answered Mar 17, 2017 at 23:37
2
  • cat ~/bin/hub-fork: hub fork $*; git remote rename origin up && git remote rename $USER origin; git remote -v Commented Mar 18, 2017 at 6:47
  • This isn't 100% accurate - Even GitHub's own UI states that you can "Compare and review just about anything", when you create a new pull request. Commented Jan 13, 2018 at 17:02

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.