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?
-
3see Where does my tool question go?gnat– gnat03/17/2017 10:55:26Commented 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)Daniel Jour– Daniel Jour03/17/2017 19:01:13Commented Mar 17, 2017 at 19:01
1 Answer 1
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.
-
cat
~/bin/hub-fork
:hub fork $*;
git remote rename origin up &&
git remote rename $USER origin;
git remote -v
rurban– rurban03/18/2017 06:47:19Commented 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.ryanwebjackson– ryanwebjackson01/13/2018 17:02:15Commented Jan 13, 2018 at 17:02