Use Git and GitHub from Spektral

A Spektral project is a folder of files, so it fits in a git repository like any other code. When your project is one, Spektral can do the everyday git work for you: see what changed, commit it, and open a pull request. You don't need a Spektral cloud plan for this, and you don't need to know git commands.

Turn it on

  1. Open a project that is a git repository

    When Spektral finds a repository, a Git repository found chip appears in the header. Spektral doesn't touch your repository until you say so.

  2. Choose whether to use it

    Click the chip and press Use git, or Not for this project to hide the chip. You can change your mind later in Settings → Version control.

  3. Not a repository yet?

    Open Settings → Version control and press Initialize repository. Spektral needs git installed on your machine; the same page tells you if it can't find it.

Read the Git chip

Once git is on, the chip in the header shows your current branch, and next to it:

It keeps itself up to date. If you switch branches or edit files in another tool, the chip catches up when you come back to Spektral.

Work from the Git panel

Click the chip to open the panel. It has everything for one piece of work, top to bottom.

  1. Pick or start a branch

    Choose a branch under Current branch to switch to it, or type a name and press New branch. If you have uncommitted changes, Spektral offers Stash and switch, which sets your changes aside, switches, and brings them back.

  2. Commit your changes

    Changes lists the files you've changed. Write a commit message and press Commit. Made a mistake? Undo last undoes the most recent commit. History lists recent commits; click one to see what it changed.

  3. Push and pull

    Under Sync with remote, Push sends your commits up and Pull brings your teammates' commits down. If the repository only lives on your machine, Publish to GitHub creates a GitHub repository for it (tick Private repository to keep it private).

  4. Open a pull request

    On any branch other than your main one, fill in a title and description, tick Draft pull request if it isn't ready, and press Open pull request. Once it's open, the panel shows it with View on GitHub. After it's merged, a button takes you back to your main branch.

Pull requests work best with the GitHub CLI. When the GitHub CLI is installed and signed in, Spektral opens the pull request for you. Without it, Spektral pushes your branch and opens GitHub in your browser so you can finish there. The panel shows how to install it, and if it's installed but not signed in, it gives you the gh auth login command to copy.

Version control settings

Settings → Version control shows what tracks your work (local only, Git, Spektral cloud, or both), whether git and the GitHub CLI are installed, and your remote. It has three switches:

Git and Spektral cloud

You can use either, or both. Spektral cloud is for designers and the wider team: live sync, change requests and releases. Git is for your repository history, CI and pull requests for engineers. Their branches are separate: switching a git branch doesn't switch your cloud branch, and the other way round. See Sync and collaborate and Review changes for the cloud side.