Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

"the fork" refers to ACME's fork of CIME:  https://github.com/ACME-Climate/cime

"the subtree" refers to all the code under https://github.com/ACME-Climate/ACME/cime

Add CIME to ACME:

This was done once.

ACME was freshly cloned and a connection was established to the cime fork:

git remote add -f --tags CIMEacme https://github.com/ACME-Climate/cime

A branch was created and checked out:   rljacob/cime-merge.

From the top level of ACME, the cime directory was added:

git read-tree --prefix=cime/ -u acme-merge1

 "acme-merge1" is a tag in the fork of CIME.

This was immediately committed with hash:   c0ffdb0103425eb121b9978621daf86fbda5e9da

Subsequent commits on the rljacob/cime-merge branch were to:

  • move model components to their cime locations
  • add cime build capability
  • remove the models directory
  • add ability to build component models with cime.

When modifications from within the subtree need be moved back to the fork:

From inside the ACME branch (or master) that contains the changes:

(The example code below is from the first time this was done)

blogin1: git subtree split -P cime/ -b rljacob/acmemerge-to-cime1
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 "CIMEacme" is the fork of cime.

blogin1[102]: git remote -v
CIMEacme	https://github.com/ACME-Climate/cime (fetch)
CIMEacme	https://github.com/ACME-Climate/cime (push)
origin	git@github.com:ACME-Climate/ACME.git (fetch)
origin	git@github.com:ACME-Climate/ACME.git (push)

Now checkout the master of CIMEacme.  Note that the presence of the mpas-o module will cause a message.

blogin1[156]: git checkout CIMEacme/master

warning: unable to rmdir components/mpas-o/model: Directory not empty
Checking out files: 100% (7985/7985), done.
Note: checking out 'CIMEacme/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 CIMEacme/master)
  master
  rljacob/acmemerge-to-cime1
  rljacob/cime-merge

At this point, you're in a "Detached head state".  You can ignore the message about mpas-o.  mpas-o becomes an untracked file and will be ignored by git in the rest of the operations.

From the detached head state, make a branch from which you'll bring the new code to cime's master.

blogin1: git checkout -b rljacob/merge-from-acme1
Switched to a new branch 'rljacob/merge-from-acme1'
blogin1]: git branch

  master
  rljacob/acmemerge-to-cime1
  rljacob/cime-merge
* rljacob/merge-from-acme1

blogin1[173]: git status
On branch rljacob/merge-from-acme1

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	components/mpas-o/

nothing added to commit but untracked files present (use "git add" to track)
blogin1[174]: 

blogin1[174]: git branch

  master
  rljacob/acmemerge-to-cime1
  rljacob/cime-merge
* rljacob/merge-from-acme1

 

 

 

  • No labels