Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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)


First step is to create a branch that contains the changes you want to move back to the external (ACME-climate/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: 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

...

Code Block
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

 

Now merge onto the branch you just created the changes that are on the branch created by the subtree split (the first command above).

blogin1[175]: git 

...

merge rljacob/acmemerge

...

_to

...

_cime1

If you're lucky, there will be no conflicts and you'll be asked to make a commit message.  If there are conflicts, resolve them with the usual procedure, add the resolved files, and commit (and finally enter the merge commit message).

You can now push the branch containing the code for the external and merge it to master using the external's procedures.