Stream: github
Topic: my branch is behind master
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?
David Pyke (Apr 07 2021 at 15:56):
git pull
John Moehrke (Apr 07 2021 at 15:57):
relative to push, and pull-request creation???? I failed to get the sequence right last time.
John Moehrke (Apr 07 2021 at 15:58):
so, I need a bit more hand holding than "git pull".
David Pyke (Apr 07 2021 at 15:58):
you would do a git pull first, then all the steps for the commit and push.
David Pyke (Apr 07 2021 at 15:58):
so, git pull
David Pyke (Apr 07 2021 at 15:58):
git commit
David Pyke (Apr 07 2021 at 15:58):
git push
John Moehrke (Apr 07 2021 at 15:59):
so that fails as the git pull says that my branch does not exist
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
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.
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
John Moehrke (Apr 07 2021 at 16:18):
thanks. Things progressed fine. The last git push didn't.
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
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
Vassil Peytchev (Apr 07 2021 at 16:20):
see the updated instruction page and note the -u flag in step 10.
John Moehrke (Apr 07 2021 at 16:21):
Thanks... would like to see the tortoiseGit rendition updated too
John Moehrke (Apr 07 2021 at 16:23):
I failed to build locally between the merge.. I am doomed
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).
John Moehrke (Apr 07 2021 at 16:25):
im crossing my fingers
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.
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