Stream: committers/git-help
Topic: How to create a remote clone
Lloyd McKenzie (Feb 02 2019 at 04:59):
One of the effects of the splitting of the HL7 code-base to have some of it live on hapifhir is that I can no longer just commit a branch to the FHIR github project and make a pull request. Instead, I need to create a remote clone (on github) of the https://github.com/hapifhir/org.hl7.fhir.core repository. However, I can't find any instructions on how to do that - everything I read about cloning tells me how to create a local clone. But apparently I can't create a pull request from that. So I need instructions on how to create a remote clone (that I can then create a local clone of, create a local branch, commit changes to my local branch, then push to my remote clone from which I can apparently create a pull request against the true source. (This seems so much more complicated than it ought to be...)
Can anyone provide such instructions/hand-holding?
Josh Mandel (Feb 02 2019 at 05:06):
I think what you're asking about is what GitHub calls a "fork".
Josh Mandel (Feb 02 2019 at 05:08):
from the link you share it above, you should be able to click the fork button to cause a copy of this h API repository to appear at https://github.com/lmckenzi/org.hl7.fhir.core
Josh Mandel (Feb 02 2019 at 05:09):
You can create any branches you like there, and once you do so you can press the pull request button.
Lloyd McKenzie (Feb 02 2019 at 06:53):
It's amazing how helpful it is to have the right terminology :)
Thanks @Josh Mandel . @Grahame Grieve, pull request made.
Lloyd McKenzie (Feb 07 2019 at 06:28):
Ok, I'm struggling again. The original that I forked has had changes made. When I look on Git, I see that my fork is 11 commits behind the master. How do I get my "remote" fork to be up-to-date so that when I pull from my local copy of the fork, it gets the current version?
Rob Hausam (Feb 07 2019 at 14:31):
what you need should be git fetch upstream
and git merge upstream/master
looking at this should help
Lloyd McKenzie (Feb 07 2019 at 15:36):
What I'm thinking I should be able to do is use Github to update my remote fork. How do I do a git fetch upstream
from the website?
Lloyd McKenzie (Feb 07 2019 at 15:36):
Alternatively, if I need to do this locally, how do I do it with TortoiseGit?
Rob Hausam (Feb 07 2019 at 15:39):
I believe you must do it locally, not through Github (my opinion). But I don't know the process of doing it with TortoiseGit, as I don't use it - but I'm sure it must be supported, as it's essential for maintaining a fork in many or most cases.
Lloyd McKenzie (Feb 07 2019 at 15:39):
@Bryn Rhodes ? (I think you know TortoiseSVN?)
Bryn Rhodes (Feb 07 2019 at 15:47):
You have to configure the upstream repository so TortoiseGit knows about it: https://www.arundhaj.com/blog/merging-upstream-repository-into-fork-tortoise-git.html
Lloyd McKenzie (Feb 07 2019 at 16:04):
That seems to be what was needed. (And I don't feel the least bit guilty about not figuring it out from just looking at the menus...) Thank you!
Lloyd McKenzie (Feb 07 2019 at 16:05):
Out of curiousity, when you're cloning a fork, why doesn't the upstream get configured automatically? Presumably the local copy knows that the remote is a fork and what it's a fork of?
Bryn Rhodes (Feb 07 2019 at 16:08):
Just speculating here but I think that since the standard use case is just cloning a repository (not necessarily a fork), the client focuses on that workflow by default.
Josh Mandel (Feb 19 2019 at 03:14):
The local copy actually doesn't, as far as I'm aware, have any way to know if its remote is "really" a fork; the system is distributed in a way that makes these distinctions relative rather than absolute.
Last updated: Apr 12 2022 at 19:14 UTC