Git workflows in depth
How branches, pull requests, merges and imports fit together when you build in Alloy, in your editor, or both.
The model
| Branch | Who writes it | Purpose |
|---|---|---|
main | You (and the first Alloy push) | What is live. Deploys from here. |
alloy/<topic>-v<n> | Alloy | One branch per prompt or group of prompts, with an open pull request |
| Your branches | You | Work in your editor; merge into main as usual |
Workflow A: Alloy only
- Prompt in the Studio. Alloy pushes a branch and opens a pull request.
- Review the preview deployment from your host.
- Click Merge into main in Manage Git. Your host deploys.
Workflow B: editor only
Clone the repository and work like any project. Alloy is not involved until you want it again.
Workflow C: both (recommended)
- Merge or close any open Alloy pull request first.
- Edit in your editor, commit and push to
main(or merge your branch). - In the Studio click Import changes from main. Resolve conflicts if any.
- Prompt again. The new version builds on your edits.
Conflicts
Import compares three versions per file. When both sides changed a file, you choose per file. Nothing is overwritten until you decide, and the result is saved as a new [external] version.
Useful commands
git switch main && git pull # get merged Alloy work
git switch -c my-change # your own branch
git push -u origin my-change # open a PR on your host
git log --oneline --graph --all # see Alloy branches