Skip to content

Switch branches and reconcile drift

Goal: switch branches in a micro’s repo and keep its manifest up to date without losing what you’ve curated.

In the micro’s editor, the Repository block:

  • Switch branch — to an existing branch.
  • Fetch — updates the remote references.
  • Pull (--ff-only) — brings the changes of the current branch.

Git access is read-only: it never does push. If there are uncommitted changes, MicroLab asks you to resolve them before switching branches; and if the micro is running, you have to stop it first.

Drift: the repo diverges from the manifest

Section titled “Drift: the repo diverges from the manifest”

When you switch branches, the micro’s ports or dependencies may change. MicroLab detects that divergence (drift) and offers Update manifest from the repository: it refreshes the fields that depend on the code (stack, ports, infra, datasource, dependencies) and keeps what was curated by hand —the startup configuration, the pre-commands and your settings—.

The dialog lists the changes before applying them (for example “New dependency”, “Ports: 8080 → 8081”, “Stack: …”), so you see what’s going to be touched.

microlab service drift <id> detects the divergence (exit 1 if there is one) and microlab service rescan <id> reconciles it while preserving the curation.