Commits
Message templates
9 min read
A template is a commit message ready to be filled in, for example:
fix({branch}):
Refs {issue}
Versora brings together three sources of templates:
| Source | Where it lives | Who sees it |
|---|---|---|
| From Git (commit.template) | The file set in commit.template in git | Whoever uses that git configuration (also on the command line) |
| From the repository | Files in .versora/commit-templates/ in the repository itself | The whole team, once the files are committed |
| My templates | Versora's preferences | Only you, in all repositories |
- Commit box › Templates button, right below the description (tooltip: "Commit message templates (the repository's and yours)").
- Click Templates. The Message templates list opens, grouped into From Git (commit.template), From the repository and My templates.
- Each row shows the template's name and its first line. Hover to see the whole text.
- Click the template (or move with the arrow keys and press Enter or Space).
- If the box already had text, the app asks "Replace the message with the template?": "The summary and description you wrote will be replaced with the "Bug fix" template. The chosen co-authors stay." Click Replace to go ahead.
- The template goes into the box: the first line becomes the summary and the rest becomes the description, with the variables already replaced and without the comment lines.
- Fill in what's missing and commit.
Esc or a click outside closes the list without changing anything.
| Option | What it does | Default |
|---|---|---|
| Comment lines | Lines that start with # are removed from the text when the template is used | Always |
| Variables | {branch}, {issue}, {author}, {email}, {date} and {files} are replaced when used (see the next section) | Always |
| Co-authors | The co-authors already chosen stay in the message after it's replaced with the template | Always |
For git's template and the {author} and {email} variables, the app reads the configuration:
git config --path commit.template
git config core.commentChar
git config user.name
git config user.email
The commit is the usual git commit -F -: git doesn't get the template, only the finished
message.
Replacing with the template changes the box's text and has no undo of its own. That's why the app asks first when there was already text written.
- "No templates yet. Save the current message as a template or create one in Preferences.": there's no template in any of the three sources.
- After using a template, check the summary: a template with
fix({branch}):leaves the short description for you to complete.
The variables are replaced with their current value at the moment the template is used.
- The list also shows up in Preferences › Commit message › Message templates › Variables: (hover over each one to see what it becomes).
| Variable | Becomes | Example |
|---|---|---|
{branch} | Current branch | feature/123-login |
{issue} | Issue from the branch name (ABC-123 or #123) | #123 in feature/123-login; PROJ-45 in feature/PROJ-45-login |
{author} | Your name (user.name) | Ana Souza |
{email} | Your email (user.email) | [email protected] |
{date} | Today's date (YYYY-MM-DD) | 2026-11-26 |
{files} | Staged files | login.ts, login.test.ts |
Details on each one:
{branch}is empty in detached HEAD.{issue}first looks for a Jira key anywhere in the branch name (PROJ-45) and, without one, a number at the start of the last part of the name (123-loginbecomes#123). Without any of that, it's empty.{author}and{email}come from the identity that applies in the repository.{date}uses the same format in every language.{files}shows only the file names (without the folder), up to five; beyond that, it adds the remaining count, for examplea.ts, b.ts, c.ts, d.ts, e.ts (+3).- A variable that isn't on the list stays as written (
{version}stays{version}).
- Write the variable between braces in the template text, in lowercase:
Refs {issue}. - Use the template through the Templates button: the value takes the variable's place.
Reads only: the current branch, the staged files and git config user.name / user.email.
- Git's
commit.templatethat goes into the empty box on its own (see the last section) also has its variables replaced, like a template chosen through the Templates button. The values are the ones at the moment the box is filled: when the panel opens and after each commit. That's why{files}usually comes out empty in this case (right after a commit, nothing is staged); to get the list, choose the template through the Templates button after staging.
When you've written a message you're going to repeat, it can become a template of yours or of the team's.
- Commit box › Templates › Save the current message….
- Write the message in the commit box (summary and, if you want, description). Where it will
vary, write the variable, for example
fix({branch}):. - Click Templates › Save the current message….
- In the Save as template window ("The current message becomes a template. Variables like
{branch}are filled in when it's used; co-authors aren't saved."), fill in Name (for example "Bug fix"). - In Where to save, choose My templates (all repositories) or In the repository (.versora/commit-templates, for the team).
- Click Save.
- If you saved it in the repository, commit the new file so the team gets the template.
| Option | What it does | Default |
|---|---|---|
| Name | The template's name. In the repository, it becomes the file name | Required |
| Where to save › My templates (all repositories) | Saves it in Versora's preferences | Selected |
| Where to save › In the repository (.versora/commit-templates, for the team) | Creates .versora/commit-templates/<Name>.txt in the working directory | — |
The saved text is the summary, a blank line and the description. The Co-authored-by lines are
removed: co-authors are chosen with each commit.
Nothing in git. In the repository, the app writes a .txt file; it shows up as a new file in the
changes, for you to include in a commit:
git add ".versora/commit-templates/Bug fix.txt"
git commit -F -
In the file name, letters, numbers, spaces, -, _ and . are kept; any other character becomes
-. The name can be up to 80 characters long.
- Your template: delete it in Preferences › Commit message (see the next section).
- Repository template: the file is a regular change. Discard it before the commit (see Discard changes) or delete it in Preferences.
- "Write the message before saving it as a template.": the box is empty.
- "Template "Bug fix" saved.": saved in My templates.
- "Template saved to .versora/commit-templates/Bug fix.txt. Commit the file so the team gets the template.": saved in the repository.
- "Give the template a name with letters or numbers (up to 80 characters).": the name can't be used as a file name.
- "Couldn't save the template: …": the folder couldn't be created or the file couldn't be written (permissions, file open in another program).
In Preferences › Commit message you create, edit and delete your templates and those of the open
repository, and you see git's commit.template.
- Preferences (Ctrl+,) › Commit message › Message templates.
- Commit box › Templates › Manage templates….
- Palette (Ctrl+P): "Commit message preferences".
- Open Preferences › Commit message. The group's note explains: "They show up under the Templates button of the commit box: yours (all repositories), the repository's (files in .versora/commit-templates/, for the team) and Git's commit.template. Lines that start with # are comments."
- To create a template of yours, click New template… next to My templates.
- Fill in Name and Text (the first line is the summary) and click Save.
- To create a team template, use New template… next to Templates of the app-web repository (only with a repository open in a tab).
- To edit, click the template in the list: the same editor opens, with Delete, Cancel and Save.
- For a repository template, commit the file that was created, changed or deleted.
| Group | What it shows | Note |
|---|---|---|
| My templates | "They apply to every repository and are included when you export/import settings." | With none: "No templates of yours yet." |
| Templates of the repository (repository name) | "They live in .versora/commit-templates/: commit them so the whole team can use them." | With none: "No templates in this repository." |
commit.template | "Git's, set in commit.template" | Read-only: it's changed in the git configuration |
In the repository, the app reads the .txt files (and also .md) in the
.versora/commit-templates/ folder, in name order, up to 100 files of up to 64 KB each. The
template's name is the file name without the extension.
Nothing in git. Repository templates are regular files:
- Save writes the file (keeping CRLF line endings, if the file already used them);
- renaming writes the new file and deletes the old one;
- Delete deletes the file from the working directory.
- A template of yours that was deleted: it doesn't come back; create it again.
- Repository template: until there's a commit, the change is a regular working directory change (it can be discarded). After the commit, it goes into the history like any file.
- "Delete the template?" with "The file .versora/commit-templates/Release.txt will be deleted from the working directory (commit the deletion for the team)." and the Delete button: only for repository templates. A template of yours is deleted right away, without a question.
- "The template is empty.": the text was left blank.
- "… isn't a repository template.": the file isn't in the templates folder (protection against deleting some other file).
- Your templates go along with Export settings, on Home (see Home and projects).
- The company policy can hide the Commit message page or make it read-only.
Git has its own message template option, commit.template. Versora honors that option: the
template goes into the empty box on its own and also shows up under the Templates button.
- Commit box (filled in on its own when it's empty).
- Commit box › Templates › From Git (commit.template) group.
- Preferences › Commit message › the repository's list (the
commit.templaterow).
- Set the template in git, for example
git config commit.template .gitmessage(path relative to the root of the repository) or with--globalfor all repositories. - Open the repository in Versora. With the commit box empty, the template is already in it.
- Fill it in and commit. After each commit, the empty box gets the template again.
- If you delete the text on purpose, it doesn't come back on its own until the next commit.
| Option | What it does | Default |
|---|---|---|
| Automatic filling | The template goes into the empty box when the panel opens and after each commit | Whenever there's a commit.template |
| Comment lines | Removed from the template, as git does: the ones that start with the core.commentChar character (or #) | Always |
| Variables | {branch}, {issue}, {author}, {email}, {date} and {files} are also replaced in automatic filling, with the values at the moment the box is filled (see Template variables) | Always |
| Unfilled template warning | Before the commit, warns if the message is the same as the template, either as it is in the file or with the variables already replaced | Whenever there's a commit.template |
git config --path commit.template # a relative path counts from the root of the repository
git config core.commentChar
Delete the text in the box or replace it with another template.
- "The message is the same as the repository's template (commit.template), with nothing filled in": a warning in the "Before committing" dialog ("Message template" group). You can go back and fill it in or Commit anyway.
- With Amend previous commit checked, the template doesn't go in: the previous commit's message applies.
- In automatic filling, the variables (
{branch}…) come already replaced. If you start writing before the replacement finishes (it reads your identity in git), your text stays and the template doesn't go in on top of it.{files}comes out with the files that were staged at the time of filling; to update it, choose the template again through the Templates button.
- Amend: amending the last commit
- Official git documentation on
commit.template: git-scm.com/docs/git-config (opens another site)