FHIR Chat · Switching to a branch · committers/git-help

Stream: committers/git-help

Topic: Switching to a branch


view this post on Zulip Grahame Grieve (Aug 05 2019 at 23:23):

So I need some help. I want to create a new clone of the FHIR repository locally, based on the R4Final branch. What's the most efficient way (in terms of bandwidth utilization) to get to there. I made a new clone of the current repo, and then rebased it to that branch from the log:

git.exe checkout -f dc5b512cc14e26d02ed075c201f90abb1e78191b --

view this post on Zulip Grahame Grieve (Aug 05 2019 at 23:24):

but I'm not sure it's doing what I want... and it looks like it's going to use a lot of my bandwidth (living in the 3rd world, as I do, bandwidth is increasingly precious to me)

view this post on Zulip Grahame Grieve (Aug 05 2019 at 23:25):

but this:

view this post on Zulip Grahame Grieve (Aug 05 2019 at 23:26):

```git.exe clone --progress --branch R4Final -v "http://github.com/hl7/fhir" "C:\work\org.hl7.fhir.old\fhirR4Final"


view this post on Zulip Grahame Grieve (Aug 05 2019 at 23:26):

gives me

view this post on Zulip Grahame Grieve (Aug 05 2019 at 23:26):

fatal: Remote branch R4Final not found in upstream origin

view this post on Zulip Grahame Grieve (Aug 05 2019 at 23:26):

but the repo where I created the branch R4Final from has nothing to commit...

view this post on Zulip Rob Hausam (Aug 05 2019 at 23:35):

Have you tried (or considered) git clone --single-branch -b <branchname> <url>?

view this post on Zulip Josh Mandel (Aug 06 2019 at 14:04):

You can also shallow clone if you don't need history (or much) with "--depth 1" (or some other number)

view this post on Zulip Grahame Grieve (Aug 06 2019 at 20:09):

I think my real question was that I labelled the branch in my local repo, and pushed to the origin, but it didn't seem to stick in the origin for some reason. I ended up labelling through the github web interface

view this post on Zulip Josh Mandel (Aug 07 2019 at 13:38):

Okay. In general --set-upstream might be what you want here. Often times the client will prompt you to do this if you're pushing to a branch that does not exist on the remote.


Last updated: Apr 12 2022 at 19:14 UTC