Working with git
Postino was designed so that requests belong in version control. There is no export step and no sync service: commit the folder, and your team has the same requests, reviewed like any other change.
Postino also has a Git client built in, for the everyday work: see what changed, commit, push, pull and fetch, switch branches and read the log. It runs the git installed on your computer, so your configuration, hooks and credentials apply as in a terminal, and it never stores a password. Everything else (see What Postino does not do) is still a job for your terminal or your usual Git tool, and Postino picks up the result when its window gets the focus back.
Recommended layout
Keep the workspace inside the repository of the API it calls:
shop/ ├── src/ ├── tests/ ├── api-requests/ # the Postino workspace │ ├── environments/ │ │ ├── local.env │ │ ├── staging.env │ │ └── staging.local.env # ignored │ ├── auth/ │ │ └── login.postino │ └── orders/ │ ├── create.postino │ └── list.postino └── .gitignore
Requests then change in the same pull request as the endpoint they call, and checking out an old commit gives you the requests that matched that version of the API.
What to ignore
# Secrets and personal overrides of Postino environments *.local.env # Load test history, if you do not want to keep it .postino/runs/
*.local.envmust always be ignored: it is where passwords, tokens and keys go..postino/runs/holds the load test run history, a JSON file and a compressed per request log for each run (the second grows with the number of requests). Commit it if you want to keep performance results with the code, ignore it otherwise.- A workspace created by Postino, with New workspace or for a Postman import, already has a
.gitignorewith both lines. Postino never edits the.gitignoreof a folder you open, so add them yourself to an existing repository. - Postino keeps everything else (settings, recent workspaces, the active environment, logs) outside the workspace, so none of it shows up in your diffs. See Files and folders.
Why the diffs stay clean
- One request per file. Changing a request touches one file.
- Line based format. Each header, query parameter and form field is its own line.
- Canonical output. Postino always writes a request the same way: same section order, same spacing, a single trailing newline,
\nline endings on every platform. Saving a request you did not change produces no diff at all. - Disable instead of delete. Switching off a header or parameter adds a
#at the start of its line, a one character change. - Minimal environment edits. Saving an environment rewrites only the lines you changed; comments and order are kept.
::: query genre = science-fiction -limit = 20 +limit = 50 # inStock = true
Reviewing request changes
A .postino file reads well on GitHub, GitLab or any diff tool. Reviewers see the exact method, URL, headers, body and tests, with no JSON noise. Use the ::: docs section to explain a request for whoever reads it next.
Merge conflicts
Conflicts in a .postino or .env file are resolved like in any text file. Keep the conflict markers out of the result: a file that still contains <<<<<<< does not parse and shows up as (broken) in the sidebar until you fix it. Postino reads files as they are on disk, so after a pull made outside Postino, reopen the workspace to see the changes.
Source Control
The Source Control button of the activity rail (Alt 2, Ctrl 2 on macOS) lists the files of the workspace that changed since the last commit. Postino runs the git installed on your computer for this: it does not bundle its own git and never stores credentials. If git is missing, the panel says so, with a link to Installing Git and a button to the Git settings (see Settings).
- The buttons at the top of the panel, next to its Commit title: Refresh reads the status again, Discard all changes puts every listed file back as it was in the last commit (asking first when Confirm before discarding changes is on), Show as a list lists the files without their folders, each with its folder after the name when there is room, and Group by folder goes back to the tree, and More actions opens a menu with Pull, Push, Fetch (see Push, pull and fetch), Show git output after a git command failed, and Open Git settings.
- Changes groups the files git already tracks, by folder; Unversioned Files the new ones git does not track yet. Requests show their method, like in Collections. The letter at the end is the kind of change: M modified, A added, D deleted, R renamed, U untracked, ! a merge conflict.
- The checkbox of a file, folder or group chooses what goes into the next commit. It is git's own staging area (the index), so it agrees with
git statusin a terminal. A box with a dash means only part of the changes is staged. - Clicking a file opens its changes in the diff tab, against the last commit. There is one diff tab: clicking another file shows it in the same tab. Side by side (the default) shows the old version on the left and the new one on the right; Unified shows one column with removed lines before added ones. Postino remembers your choice, and uses Unified anyway when the area is narrower than 720 px. For a request, Request shows the changes grouped by part of the request instead of as text: the method and URL, headers, query parameters, auth, the body (field by field when it is JSON, like
"amount": 250) and the scripts, then the parts that did not change. When one of the two versions does not parse, only the text layouts are offered. Over the lines, the old side is titled HEAD with the short id of the last commit, and the new one Working tree. Requests,.envfiles, JSON and JavaScript files are shown with syntax colors, and on a changed line the words that changed are highlighted. A block of changes is a run of removed and added lines. The diff opens on the first one; Prev and Next, or Shift F7 and F7, go to the previous and next block, and the counter says which one you are on (a click on a changed line makes its block the current one). On the last block, F7 shows Press F7 again to go to the next file, and a second F7 opens the diff of the next file of the panel, on its first block; Shift F7 on the first block does the same with the previous file, landing on its last block. Open file, or F4, opens the file at the current block: a request opens in its editor on the tab of the changed part (Headers, Body, Post-response...), with the cursor on the changed line in the body, script and docs editors; an environment file opens its environment; any other file opens in the application your system uses for it. In a narrow area (under 1100 px, the main area of a window narrower than about 1400 px with the sidebar showing), Prev, Next and Open file show only their icons, with their names and keys as tooltips, and the counter reads 1/7; under 760 px the status shows as its letter and the layouts as icons too. The folder of the file is cut first, then its name. The keys work while the diff tab has the focus: it takes it when it opens a file or becomes the active tab. The diff follows the file: it updates when the file changes on disk. - Hovering the first line of a block of changes shows its buttons. Stage puts only that block in the next commit, and Unstage takes it back out; a file with some blocks staged shows a dash in its checkbox. Revert puts the block back as it was in the last commit, asking first when Confirm before discarding changes is on.
- Hovering a row shows Discard changes, which puts the file back as it was in the last commit, or deletes it when it is new. With Confirm before discarding changes on (the default), Postino asks first. Discarded changes cannot be recovered.
- When the workspace is a folder inside a bigger repository, the panel only lists the workspace's files. If files outside it are staged, a notice warns that they will go into the commit too, with a button to unstage them.
- When the workspace is not in a repository yet, Initialize repository runs
git initin it and adds the.gitignoreabove when there is none. New workspace does the same with its Initialize a Git repository checkbox, on by default when git is available and hidden when the new folder is already inside a repository.
The list refreshes on its own when files change on disk, when the window gets the focus back and after Postino saves a file, so a commit or a checkout made in a terminal shows up right away.
Committing
The bottom of the Source Control panel holds the commit message, with the summary of the commit at the start and, after a blank line, its description. The commit includes what is staged, the files with a checked box, and the line under the message counts them with the lines they add and remove, such as 4 files · +31 −9. The message box stays disabled while nothing is staged, unless Amend is ticked, since there would be nothing to commit.
- Commit commits the staged changes with the message and clears it.
- Commit and Push… commits, then lists the commits that will be sent and where, and pushes them when you confirm. If you cancel, the commit stays and you can push later.
- Ctrl Enter (⌘ Enter on macOS) in the message runs the Default commit action of the Git settings, Commit unless you change it.
- Amend replaces the last commit instead of adding a new one: with it ticked, the commit takes the staged changes into the last commit and uses the message as its new message. Ticking it with an empty message brings back the last commit's message, so you can also fix only the message. Do not amend a commit you already pushed.
With Block commits with secrets on (the default), a staged .local.env file stops the commit: those files hold the secret values of an environment (see Environments). A banner names the file, with Unstage to take it out of the commit and Add to .gitignore, which adds the file to the repository's .gitignore and unstages it.
When a commit fails, a notification says why in plain words, for example that git does not know who you are because user.name and user.email are not set, or that a hook stopped the commit. Show git output shows what git printed.
Push, pull and fetch
Postino runs these commands with the git on your computer, so they use its own credentials: the credential helper or the SSH agent you already have. Postino never asks for a password and never stores one. When git needs credentials it cannot get on its own, the notification says so; set them up in a terminal once, then try again.
- Push sends the commits of the current branch. The first push of a branch creates it on the remote and sets it as the branch's upstream:
origin, or the remote set inremote.pushDefault, or the only remote when there is one. When the panel has no changes and there are commits to send, it shows a Push button with their count. - Pull brings the remote's commits into the current branch as the Pull strategy setting says: following
pull.rebasefrom git config, and merging when it is not set. A merge never opens an editor, it uses git's default message. Afterwards Postino reads the workspace again, so new and changed requests and environments show up in the sidebar. If the pull leaves conflicts, the panel lists the conflicted files; resolve them in your editor or merge tool, then commit. - Fetch only reads the remote, to update the counts in the status bar; it never changes your files. With Fetch automatically on (the default), Postino fetches when its window gets the focus back, at most once every five minutes. It does nothing while the window stays in the background, and a failed automatic fetch, for example while offline, shows no notification.
When a push is rejected because the remote has commits you do not have, the notification offers Pull and push, which pulls them and pushes again, and Show git output. Commands run one at a time, in the order you started them.
The status bar
When the workspace is inside a git repository, the status bar shows the current branch, or the short commit hash on a detached HEAD. With git installed Postino asks git; without it, it reads .git/HEAD when the workspace opens and when its window gets the focus back. Worktrees are supported.
Next to the branch, ↑ with a number counts the commits you have that its upstream does not (to push), and ↓ the commits the upstream has that you do not (to pull), as of the last fetch. While a commit, push, pull, fetch or checkout runs, the status bar says so, for example Pushing…. When git is available, the branch is a button that opens the branch menu.
Branches
Click the branch in the status bar (tooltip Branches), or choose Git: Checkout branch in the command palette. The menu has a search field, Search branches and actions, and lists the branches in groups:
- Recent: the local branches you checked out last, at most five, the current one first (marked with a check).
- Local: the other local branches.
- Remote · origin (one group per remote): the remote branches, such as
origin/main.
Tags are not listed here, you check them out from the log. Each row shows the subject of its last commit and when it was made, and ↑ and ↓ counts when the branch is ahead of or behind its upstream. The star at the end of a row makes the branch a favourite: favourites come first in their group. They are saved in the git_favorite_branches setting, shared by every repository (see Settings). The chevron at the end of a row opens a submenu with more actions for that branch. At the bottom of the menu there are four actions: New branch, Pull (with the number of commits to bring), Push (with the number of commits to send) and Log.
With the keyboard, ↑ and ↓ move through the rows, Enter checks out the highlighted branch, Ctrl Enter (⌘ Enter on macOS) creates a branch named like the text you typed, from the current branch, and Esc closes the menu. When the text is not the name of a local branch, a Create branch row offers the same with a click.
The branch submenu
- Checkout switches to the branch. It is disabled for the current branch.
- New branch from 'name'… asks for a name, creates the branch starting at that one and checks it out.
- Compare with 'current' opens the log with the commits of that branch that the current one does not have. Disabled for the current branch.
- Show log opens the log filtered to that branch.
- Rename… asks for the new name.
- Delete asks first. If git says the branch is not merged anywhere else, Postino asks again (Delete anyway) before it forces the deletion, because its commits would be lost. Disabled for the current branch.
Rename and Delete are disabled for remote branches: Postino never changes a remote. When a branch operation fails, the message of git appears in a banner.
Checking out with uncommitted changes
If you have uncommitted changes, Postino asks Check out name? first, with two choices:
- Stash and check out (the default) puts your changes aside, tagged with the branch they belong to, and checks out. When you come back to that branch Postino restores them by itself and tells you with a notification. Stashes you made yourself are not touched.
- Bring changes takes the changes along to the other branch. It only works if they do not conflict with it; if git refuses, nothing moves.
Checking out a remote branch checks out its local tracking branch, and creates it when it does not exist yet. After a checkout Postino reads the workspace again, so the requests and environments of the other branch show up in the sidebar.
The log
The Git log tab shows the history of the repository with its commit graph. Open it with the Log button of the Source Control panel, with Log or Show log in the branch menu, or with Git: Show log in the command palette. There is one log tab: opening it again reuses it. It reads again by itself when HEAD moves, and the refresh button of the filter bar reads it on demand.
The tab has three columns. Drag the line between two of them to resize the branches or the detail; they keep their width when the window or the sidebar changes, and the commit list takes the rest. Every list and the commit message scroll on their own.
- Branches, on the left: All branches, then Local, Remote · remote and Tags. The field at the top, Filter branches, narrows the names. A click on a row filters the log by it, a double click checks it out (a tag leaves
HEADdetached), and a right click offers Checkout, New branch from… and Show log. The current branch comes first, then the favourites. - The commit list, in the middle, with the graph, Subject (with badges for
HEAD, branches, remote branches and tags, three at most and a +N for the rest), Author, Date and Commit (the short hash). Drag the left edge of the Author, Date or Commit title to resize that column, for as long as the tab is open. It loads 200 commits at a time while you scroll. After a click on a commit, ↑ and ↓ select the previous or next one, Page Up and Page Down move one screen, and Home and End go to the first and last loaded commit (see Keyboard shortcuts). A right click on a commit offers New branch from here…, Checkout revision (which leavesHEADdetached) and Copy commit id. - The detail, on the right, of the selected commit: its message, Author, Date, Commit (click it to copy the full id) and Parent (a click selects that commit). The buttons New branch… and Checkout revision act on this commit. Below, the Changed files with their change letter and added and removed lines; drag the line between the message and the files to give either more height. A click on a file opens its changes in the diff tab, with the parent commit on the left and the commit on the right. There, F7 and Shift F7 go past the last or first block to the next or previous file of the commit.
The filter bar over the list narrows what is shown:
| Filter | What it matches |
|---|---|
| Message or hash (search box) | Commits whose message or hash contains the text. |
| Branch | The history of one branch, remote branch or tag, picked from its list: local branches first, then remote ones, then tags. Type in its search box to narrow the list. Show all branches, at the top, goes back to every branch. A click in the branch column picks the same. |
| Author | Commits whose author name or email contains the text. |
| Path | Commits that touch a file or folder, written relative to the workspace: auth/login.postino for one request, environments or auth/ for everything in a folder. |
The filters apply after a short pause in your typing. While the author, path or text filter is active the graph is hidden, because a list with commits skipped would draw lines that lead nowhere. The branch filter keeps the graph.
Git in the command palette
The command palette (Ctrl K) has these actions when the workspace is inside a repository and git is available:
| Action | What it does |
|---|---|
| Git: Commit | Commits the staged changes when the commit message is not empty. Otherwise it shows Source Control, with the cursor in the message when something is staged. |
| Git: Commit and Push | The same, then asks to push as Commit and Push… does. |
| Git: Push | Pushes the current branch. |
| Git: Pull | Pulls with the Pull strategy setting. |
| Git: Fetch | Fetches the remote. |
| Git: New branch | Asks for a name and creates the branch from the current one. |
| Git: Checkout branch | Opens the branch menu. |
| Git: Show log | Opens the log. |
When the workspace is not in a repository yet, the only Git action is Git: Initialize repository. Without git, there are none.
What Postino does not do
The Git integration covers the daily flow, not all of git. Use a terminal or another tool for:
- Resolving merge conflicts. Postino lists the conflicted files with the ! letter, but you edit and resolve them elsewhere, then commit.
- Merging or rebasing a branch into another, cherry-picking and resetting. A pull merges or rebases as the Pull strategy says, nothing more.
- Managing stashes. Postino only stashes by itself when you check out a branch with changes, and restores that stash when you come back.
- Creating tags, blame, cloning a repository and adding or changing remotes.
- Storing credentials: git asks its own credential helper or SSH agent.
Installing Git
Postino needs git 2.30 or later. Check the version you have in a terminal:
git --version
Linux
Install it with your distribution's package manager:
sudo apt install git # Debian, Ubuntu, Linux Mint sudo dnf install git # Fedora sudo pacman -S git # Arch, Manjaro sudo zypper install git # openSUSE
macOS
Install the Xcode Command Line Tools with xcode-select --install in a terminal, which includes git. With Homebrew, brew install git gives you a more recent version. Until one of them is installed, /usr/bin/git only opens Apple's installer, so Postino reports that the Command Line Tools are missing instead of running it.
Windows
Download Git for Windows and run the installer with its default options, or use winget:
winget install --id Git.Git -e
Projects inside WSL
On Windows, a workspace kept inside WSL 2, opened through its Windows path such as \\wsl.localhost\Ubuntu-24.04\home\me\api (or \\wsl$\...), uses the git installed in that distribution, not Git for Windows. Postino runs it through wsl.exe, so git reads the repository on its own Linux file system, with your Linux git configuration, credential helper and SSH keys. Git for Windows is not needed for these workspaces. Install git inside the distribution as on Linux (sudo apt install git).
This happens with Auto-detect, and Postino detects git again when you open a workspace in another distribution or outside WSL. To choose that git yourself, pick it with Browse… on the WSL share, for example \\wsl.localhost\Ubuntu-24.04\usr\bin\git. Settings then shows the distribution, such as git version 2.43.0 (WSL: Ubuntu-24.04). Git commands go through wsl.exe. Postino keeps it running between commands, so only the first one of a session waits for it to start, and the very first also starts WSL when it is not running. To go back to starting wsl.exe for every command, set the environment variable TELAIO_GIT_WSL_SESSION=0 before opening Postino.
After installing
Open Settings, Git and click Detect again, or restart Postino. If git is installed somewhere outside your PATH, pick the executable with Browse… in the same section.
Line endings
Postino reads both \n and \r\n and always writes \n. If your repository converts line endings on Windows (core.autocrlf), add this to .gitattributes so files stay identical on every system:
*.postino text eol=lf *.env text eol=lf