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
- 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.
- 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.
- 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:
- •3: three files have changes you haven't committed.
- ↑2: two commits on your machine that the remote doesn't have yet.
- ↓1: one commit on the remote that you haven't pulled.
- #42 open: the pull request for this branch, and whether it's open or merged.
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.
- 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.
- 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.
- 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).
- 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.
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:
- Use git for this project turns the Git chip and panel on or off.
- Commit after each agent run commits the agent's work when it finishes, with the run's summary as the message. When the agent creates a new component while you're on main, the commit goes on a new
component/<name>branch. - Let the agent use git lets the agent check the repository, commit and make branches when it helps. It always asks you before it pushes, pulls or opens a pull request.
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.