"the fork" refers to ACME's fork of CIME: https://github.com/ACME-Climate/cime
"the upstream repo" refers to ESMCI CIME: https://github.com/ESMCI/CIME
"the subtree" refers to all the code under https://github.com/ACME-Climate/ACME/cime
Initial add of CIME to ACME:
...
git remote add esmcicime git@github.com:ESMCI/cime.git
When modifications from within the subtree need be moved back to the
...
upstream repo:
(The example code below is from the first time this was done)
...
First step is to create a branch that contains the changes you want to move back to the external (ACME-climateESMCI/cime CIME in this case). The branchname should follow ACME conventions. NOTE: the command below must be issues from the top directory of ACME.
Code Block |
---|
blogin1%%First Time Only: git subtree split -P cime/ -b rljacob/acmemerge-to-cime1 (first time) blogin1: git subtree split --prefix cime/ --ignore-joins -b rljacob/acmemerge-to-cime1 (after there's been merges back-and-forth). Created branch 'rljacob/acmemerge-to-cime1' fe8c483486af5b95f24ee64ce45ccb6d6fb6061e blogin1: git branch master rljacob/acmemerge-to-cime1 * rljacob/cime-merge |
Make sure you have a name for the external's git repo. In below, "origin" is the usual ACME repo and "CIMEacmeesmcicime" is the fork upstream repo of cime.
Code Block |
---|
blogin1[102]: git remote add esmcicime git@github.com:ESMCI/CIME.git blogin1[102]: git remote -v CIMEacmeesmcicime httpsgit@github.com:ESMCI//github.com/ACME-Climate/cimeCIME.git (fetch) CIMEacmeesmcicime httpsgit@github.com:ESMCI//github.com/ACME-Climate/cimeCIME.git (push) origin git@github.com:ACME-Climate/ACME.git (fetch) origin git@github.com:ACME-Climate/ACME.git (push) |
Now checkout the master of CIMEacmeesmcicime. Note that the presence of the mpas-o module will cause a message.
Code Block |
---|
blogin1[156]: git fetch esmcicime blogin1[156]: git checkout CIMEacmeesmcicime/master warning: unable to rmdir components/mpas-o/model: Directory not empty Checking out files: 100% (7985/7985), done. Note: checking out 'CIMEacmeesmcicime/master'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b <new-branch-name> HEAD is now at b496e53... Merge branch 'jgfouca/skybridge_working' (PR #7) blogin1: git branch * (HEAD detached at CIMEacmeesmcicime/master) master rljacob/acmemerge-to-cime1 rljacob/cime-merge |
...