Skip to content

Backend: Keeping your local environment up to date

Tim K edited this page Sep 3, 2018 · 6 revisions

Keeping code base in sync

It is important to keep your local development environment up-to-date with online Fizzyo-backend repository, namely the dev branch. To sync your local dev you can do the following:

$ git checkout dev     # Switch to local `dev` branch
$ git fetch -a         # Fetch all updates from remote repository
$ git status           # See if you're missing any commits locally
$ git pull origin dev  # Pull remote changes

There are three possible scenarios here:

  1. Pull is successful. Everything is probably okay, but you should run tests just in case to make sure nothing broke: npm run test-all.
  2. Pull went through but generated merge conflicts. This means you will have to manually resolve merge conflicts. Check out this guide from GitHub. Merge conflicts can be tricky to resolve, so make sure to Google around for advice. If needed, contact someone from the Fizzyo core development team.
  3. Pull was rejected because you have unstaged changes. You can try using git stash, but make sure you understand what it does before using it.

Keeping database in sync

Given other developers did not mess up, this should be as easy as switching to Fizzyo-backend folder and running automatic migration script:

$ cd Fizzyo-backend/
$ npm run migrate-db dev

This operation will do nothing if no new migrations are found, so you can run it preemptively whenever you pull in new code.