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

Checkout to the main branch on your instantiated template.

git checkout inst_main
Branches:
|  main (readme)
|  <inst_main> (readme)
|  inst_env_n (readme,+maps)

Then proceed with the merge. When a template is instantiated, it's git history begins new. This means it cannot merge directly as the two branches have different histories. Merge with the argument of --allow-unrelated-histories to circumvent this. This will highlight all of the changes made to main from the point of instantiation.

git merge main --allow-unrelated-histories

Template Main -> Local

Finally, checkout to your environment's branch to merge the changes from your instantiated main into there.

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