Esmvaltool: Merging or updating local branches with new master

Created on 19 Feb 2020  路  10Comments  路  Source: ESMValGroup/ESMValTool

I would like some guidance on how to update my local branches under ESMValTool and ESMValTool-private with the new master branch. Specifically, I have the following questions:

a) I have a local branch which has recipes and diagnostics under development that I am not ready to push yet and will likely take a few more months before I push up. How do I update them with the master copy? I did a ''git pull origin master'' to get the latest update but it seems like the config-references file is missing a few entries. I do not know if any merge is required as @valeriupredoi suggested in the email notifying us about the master branch. Can someone suggest the correct order of steps I need to follow to update a local branch ?
b) I need to revisit a branch I pushed up earlier to test some new data. I want to update this branch and test the new data, update any code if needed (even if it is only comments) and push up again. I believe the branch (cmorize_FLUXCOM-GPP) is not deleted since I can see it with a "git branch -a" command. Will it be possible to do this?

I understand most of these are Github related questions but since the mid-January notification, I haven't updated my local code base and want to make sure it is updated and I do not lose any data. Thanks!

help wanted

Most helpful comment

Hi there! I hope all is well. 馃憤

All 10 comments

@rswamina -> @valeriu is not me, it's someone else who's the same great and awesome name as myself :grin:

For your issue:

  • point a) -> say your branch is called ranjini_branch: best if you push it to remote nonetheless, we can always remove it if need be
[first get the latest master]
git checkout master
git pull origin master
[get onto your local branch]
git checkout ranjini_branch
[push to remote]
git push origin ranjini_branch
[merge master to be up to date]
git merge master
[fix any conflicts if case]
[then push to remote again]
git push origin ranjini_branch
  • point b) pretty much the same bar pushing to remote (that's already been done):
[first get the latest master]
git checkout master
git pull origin master
[get onto your local branch]
git checkout ranjini_branch
[pull the latest]
git pull origin ranjini_branch
[merge master to be up to date]
git merge master
[fix any conflicts if case]
[then push to remote again]
git push origin ranjini_branch

Apologies @valeriupredoi ...indeed I thought the name was uniquely awesome! Will try this and post here.

Hi there! I hope all is well. 馃憤

@valeriupredoi - What if the branch I used to develop some code was deleted during the cleanup? Should I create a new branch to run the tests planned and push it up afresh?

Hi there! I hope all is well. +1

sorry mate, all good, just a wee mixup of user names :beer:

Hi there! I hope all is well. 馃憤

My mistake. Sorry!

@valeriupredoi - What if the branch I used to develop some code was deleted during the cleanup? Should I create a new branch to run the tests planned and push it up afresh?

what is the branch name? Surely we didn't delete anything without prior asking. If it really got deleted then yes, create a new branch holding the code changes needed and push to remote and create a PR - you don't have to ask for merging right away, you can create a draft PR that you can keep working on :beer:

can we close this issue @rswamina ? - we can take it offline via email if need be

@valeriupredoi - It is the cmorize_FLUXCOM-GPP which I guess was deleted since all changes were pushed up and merged. So I will create a new branch to test what I need to now and put any related details under the relevant issue (https://github.com/ESMValGroup/ESMValTool/issues/1226).
At this time, I do not have unanswered questions but if I run into further issues with the merging would like to reopen this issue if possible.

if it's merged then you are in a very good position to just grab master and start sailing into the code sunset afterwards :grin: ie make your changes on a new branch (git checkout -b ranjini_new_branch), commit then push to remote and open a new PR (could be draft or not, up to you)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

valeriupredoi picture valeriupredoi  路  4Comments

BenMGeo picture BenMGeo  路  5Comments

chris-to-pher picture chris-to-pher  路  3Comments

valeriupredoi picture valeriupredoi  路  4Comments

bouweandela picture bouweandela  路  3Comments