Skip to content

Upgrading v0.0.0 Template

James Heselden edited this page May 29, 2024 · 4 revisions

How to upgrade from version v0.0.0 (unversioned) to version v1.0.0 (released 28 May 2024).

It is advised to retain a main branch on your instantiated template to simplify this upgrade process. It is assumed for these instructions, that you have this main branch retained.

This is a simple guide, if you need further assistance please open an Issue.

Starting point

Clone LCAS/main to a new workspace. It is advised to complete this process in a fresh workspace to simplify the process.

git clone https://github.com/lcas/environment_template.git --single-branch -b main
Branches:
|  <main>

Template Instantiated

Add as a remote, the link to your instantiated template. Then checkout the main branch in your repository.

git remote add inst https://github.com/fork/template_name.git
git checkout inst/main
git switch -c inst_main
Branches:
|  main
|  <inst_main>

Checkout Environment

Checkout the branch which contains your environment details.

git checkout -b inst_env_n
Branches:
|  main
|  inst_main
|  <inst_env_n> (+maps)

Version Updated

To begin the upgrade, checkout the LCAS/main (on the tag matching the version you wish to upgrade to).

git checkout main
#or
git fetch --all --tags --prune
git checkout tags/v1.0.0
Branches:
|  <main> (readme)
|  inst_main
|  inst_env_n (+maps)

Template Main -> Local

git checkout inst_main
Branches:
|  main (readme)
|  <inst_main> (readme)
|  inst_env_n (readme,+maps)
git merge main --allow-unrelated-histories

Template Main -> Local

git checkout inst_env_n
Branches:
|  main (readme)
|  inst_main (readme)
|  <inst_env_n> (readme,+maps)
git merge inst_main
  1. Checkout the branch you wish to upgrade:

git checkout rih0012

  1. Merge the changes of the template into the environment. At the point of instantiating a template, the git history will be only an Initial Commit, thus the branches cannot be merged directly. On merging them, all history of main will be copied into your instantiated template. To allow merging, the argument of --allow-unrelated-histories must be used:

git merge main --allow-unrelated-histories

  1. This will highlight all of the changes made to main from the point of instantiation. Add the changes, commit and push back to your repository.