FHIR Chat · my branch is behind master · github

Stream: github

Topic: my branch is behind master


view this post on Zulip John Moehrke (Apr 07 2021 at 15:55):

What is the proper way to update my branch when master has been improved while I was working on my branch?

view this post on Zulip David Pyke (Apr 07 2021 at 15:56):

git pull

view this post on Zulip John Moehrke (Apr 07 2021 at 15:57):

relative to push, and pull-request creation???? I failed to get the sequence right last time.

view this post on Zulip John Moehrke (Apr 07 2021 at 15:58):

so, I need a bit more hand holding than "git pull".

view this post on Zulip David Pyke (Apr 07 2021 at 15:58):

you would do a git pull first, then all the steps for the commit and push.

view this post on Zulip David Pyke (Apr 07 2021 at 15:58):

so, git pull

view this post on Zulip David Pyke (Apr 07 2021 at 15:58):

git commit

view this post on Zulip David Pyke (Apr 07 2021 at 15:58):

git push

view this post on Zulip John Moehrke (Apr 07 2021 at 15:59):

so that fails as the git pull says that my branch does not exist

view this post on Zulip John Moehrke (Apr 07 2021 at 16:05):

The instructions https://github.com/HL7/fhir/wiki
should be updated to include the check to see if master has changed

view this post on Zulip John Moehrke (Apr 07 2021 at 16:05):

This is normally not a problem, but during deadline it is.. and the build, especially the vscache files, is very touchy.

view this post on Zulip Gino Canessa (Apr 07 2021 at 16:09):

Normally, I do something like (and yes, I know I don't need to fetch and pull separately, but I like to :stuck_out_tongue: )

git checkout master
git fetch
git pull
git checkout <branchBeingWorkedOn>
git merge master

At that point, it will either succeed via fast-forward or take you into a conflict-resolution workflow. After that, all that's left is (assuming the branch has been created on the server):

git push

view this post on Zulip John Moehrke (Apr 07 2021 at 16:18):

thanks. Things progressed fine. The last git push didn't.

view this post on Zulip John Moehrke (Apr 07 2021 at 16:18):

$ git push
fatal: The current branch moehrke-security-CR has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin moehrke-security-CR

view this post on Zulip John Moehrke (Apr 07 2021 at 16:19):

but I went back to tortoiseGit and did a push, and now created the pull-request... I hope it works out this time

view this post on Zulip Vassil Peytchev (Apr 07 2021 at 16:20):

see the updated instruction page and note the -u flag in step 10.

view this post on Zulip John Moehrke (Apr 07 2021 at 16:21):

Thanks... would like to see the tortoiseGit rendition updated too

view this post on Zulip John Moehrke (Apr 07 2021 at 16:23):

I failed to build locally between the merge.. I am doomed

view this post on Zulip Gino Canessa (Apr 07 2021 at 16:24):

Blah. I should have put that in the set too (I was just going from muscle memory on git repos instead of the FHIR core).

view this post on Zulip John Moehrke (Apr 07 2021 at 16:25):

im crossing my fingers

view this post on Zulip Vassil Peytchev (Apr 07 2021 at 16:27):

I failed to build locally between the merge.. I am doomed

I left the previous "build before commit" step in the instructions, but in my mind, that is not necessary. Building after the merge is definitely helpful though.

view this post on Zulip Vassil Peytchev (Apr 07 2021 at 16:49):

John Moehrke said:

I'm crossing my fingers

Maybe that is what prevented the earlier attempt from succeeding... Should this be added to the instructions? :grinning:


Last updated: Apr 12 2022 at 19:14 UTC