Upgrading Guide

Newer is (always) better! Follow the guides below to upgrade your Headstart installation or your project files.


Upgrading Headstart

Upgrading is easy through NPM.
Depending on how you've configured NPM, it's possible that you'll need sudo rights for this.

npm update -g headstart

Upgrading project files

Newer versions of Headstart might require some changes to your project setup. If you upgraded your installation, it is advised to upgrade your project files or forked boilerplate as well.

Set up git

Since the downloaded boilerplate files aren't linked to git, you need to initialize. This step can be skipped when upgrading your forked boilerplate repo.

cd my/project/folder
git init

Then, add and commit your local files so you can merge later on:

git add -A
git commit -m "local"

Add a remote

Next step for your "repository" is to add a remote that points to the upstream repository on Github

git remote add upstream https://github.com/flovan/headstart-boilerplate.git

You can check to see if it has been added by running:

git remote -v

Fetch and merge changes

Next up is fetching the latest changes:

git fetch upstream

This will pull the branches from the default boilerplate repository down. You can now merge your local copy with the fetched files, without losing your local changes. The first commando below makes sure that you are working on the master branch of your repository, while the second one will merge with the master branch of the remote repository.. If you want to upgrade to or from a different branch, change the references first before running these.

git checkout master
git merge upstream/master

Git will now go over all the files, and try to auto-merge changes. It is quite normal that "CONFLICT"s appear in the output. This just means you will have to manually inspect and merge the changes.

To see a better overview on newly added and changed files, run:

git log

Copy the commit hash—which will be a random string of letters and numbers—from the output. For example a2b739325c0e43250fa9374bcf2113e65379c3cf. Then run:

git diff --name-status <copiedHashGoesHere>

Lines starting with "A" are newly added files. Lines starting with "M" indicate modified files that will need inspecting. Git will have added markers in each conflicting file so you can easily compare and fix issues:

<<<<<<< HEAD
// YOUR LOCAL CODE
=======
// CODE FROM UPSTREAM
>>>>>>> upstream/master

You can go up and down the list with your arrow keys, and quit by typing q and confirming with enter. After checking all files and fixing merge issues, your project should be all set to run with the latest version of Headstart.