Skip to content
Versora

Manual

Commits

The commit box

21 min read

On this page

The commit box sits at the bottom of the changes panel, on the right side of the window. It shows up when the // WIP row is selected in the graph (or when no commit is selected). That's where you write the message, choose the options and record the commit.

From top to bottom, the box has:

  1. the Free-form | Conventional message mode selector (see Conventional Commits);
  2. the Commit summary field, with the character counter;
  3. the Description (optional) field, with the expand button in the corner;
  4. the Templates and Co-authors buttons and the people already chosen (see Templates and Co-authors);
  5. the issue reference button, when the branch has an issue (for example Closes #123);
  6. the Amend previous commit checkbox (see Amend);
  7. the collapsible Commit options block;
  8. the Commit surgery bar ("Commit as fixup of…", "Absorb…"), explained in Commit surgery;
  9. the Commit as line, with the email that goes into the commit;
  10. the repository rules strip, when the team or the company has rules;
  11. the commit button.

Write and record a commit

The usual path: stage what goes into the commit, write the summary and click the button. Versora builds the message, checks what needs checking and runs git commit.

Where to find it

  • Changes panel: select the // WIP row at the top of the graph; the box is at the bottom of the right panel.
  • Shortcut to get to the message: Ctrl+Shift+M ("Go to the commit message").
  • Shortcut to commit: Ctrl+Enter with the focus in any field of the box (the button's tooltip shows "Shortcut: Ctrl+Enter").

Step by step

  1. Stage the files, hunks or lines that go into the commit (see Staging).
  2. Click Commit summary and write a short line, for example Fix the login form validation.
  3. If you need to explain why, write it in Description (optional). It can have several paragraphs.
  4. Check the commit button's text: it says what is going to happen, for example Commit 2 files.
  5. Click the button or press Ctrl+Enter.
  6. While the app checks, the bar shows "Checking before commit…"; during the commit, "Committing…".
  7. Done: the commit shows up in the graph, the box is empty and the one-time options (such as Skip Git hooks) are unchecked again.

The button text

The button changes with the state of the panel. When it's disabled, the text says what's missing:

Button textWhen it shows up
Resolve conflicts to commitThere are files in the "Conflicted" section
Stage changes to commitNothing staged, no amend and no merge in progress
Type a message to commitThe summary is empty
Commit 1 file / Commit 3 filesReady to commit (the number is the number of staged files)
CommitMerge in progress with no staged files (the commit concludes the merge)
Amend previous commitThe amend checkbox is checked

The checked options are added at the end of the text: Commit 2 files without hooks, Commit 2 files and push or Commit 2 files without hooks and push.

OptionWhat it doesDefault
Per-repository draftThe summary and the description are kept while you switch tabs or select another commit in the graphAlways on, while the app is open
Prepared squash merge messageWhen a local squash merge stops midway (conflict or hook), the box shows "Prepared message from the squash merge of feature/login" with Use and the dismiss buttonGoes in on its own if the box is empty
commit.templateWith a message template configured in git, the empty box starts with it, with the variables ({branch}, {issue}, {author}…) replaced (see Templates)Only if git has commit.template

What Versora does in git

The message is the summary, a blank line and the description, with no extra spaces at the ends. It goes to git through standard input, always in UTF-8:

bash
git -c i18n.commitEncoding=UTF-8 commit -F -
# with "Skip Git hooks":
git commit -F - --no-verify
# with "Amend previous commit":
git commit -F - --amend

The commit takes only what is staged (the index). No text editor is opened. If git is configured to sign (commit.gpgsign), signing happens in this same command (see Commit signing).

How to undo

  • Ctrl+Z (outside a text field) or the undo button on the bar undoes the commit. The button shows "Undo: Commit "Fix the login form validation" (Ctrl+Z)".
  • Versora moves the branch back to the previous commit with git reset --soft: the commit's changes go back to Staged files, ready for a new commit.
  • The message doesn't come back to the box. Ctrl+Shift+Z (redo) recreates the commit exactly as it was.
  • The commit that concludes a merge in progress undoes the entire merge: the branch goes back to the commit before the merge, and so do the files (git reset --hard, without the staging middle ground, which on the next commit would become a squash without the second parent). If Versora started the merge, the button shows its name (for example "Undo: Merge feature/login into main"). The steps taken while the merge was stopped, such as resolving a file in the conflict editor, leave the undo history at that point. The same goes for the commit that concludes a stopped cherry-pick or revert that Versora started: undo removes the whole operation. See Stopped merge, rebase, cherry-pick and revert.
  • If the commit has already been pushed (for example, with Push after committing), Ctrl+Z undoes only the local branch. The commit stays on the remote, and the branch's next push will have to be forced.

Details in Undo and redo and in the Timeline (Alt+Z).

Tip

Inside a text field, Ctrl+Z is the field's own undo (the text you typed), not Versora's undo. To undo the commit, click outside the field (on the graph, for example) and press Ctrl+Z, or use the undo button on the bar.

Caveats and messages

  • "Checking before commit…": the app is running the checks. A second click on the button in the meantime is ignored.
  • "Before committing", with Commit anyway: one or more checks found something (see Checks before the commit).
  • "The commit was not created": git rejected the commit. The output stays in the box (see When the commit is rejected).
  • "Git identity not configured": user.name or user.email is missing. Set up identity opens Preferences › Profile. Nothing is lost: what was staged stays there.
  • Description lines that start with # go into the commit as they are. Versora doesn't treat them as comments (only templates have comments), unless your git commit.cleanup setting says otherwise.
  • Preferences › Commit › Message: recommended summary length and Push after commit.
  • Preferences › Operations › Commit: automatic wrapping of the body.
  • The company policy can make these pages read-only or hide them (see Company policy).

See also

The summary is the first line of the message: it's what shows up in the graph, in commit lists and in merge requests. A short summary shows in full almost everywhere.

Where to find it

  • Commit box › Commit summary field.
  • Counter: the number to the right of the field is how many characters still fit within the recommended length.
  • Length: Preferences › Commit › Message › Recommended summary length.

Step by step

  1. Write the summary. The counter goes down with each letter.
  2. If the counter turns red (a negative number), the summary went past the recommended length. Hover over the counter to read: "Summaries up to 72 characters show in full in most tools (adjust the limit in Preferences › Commit)".
  3. Shorten the summary and move the details to the description. The commit isn't blocked because of this: it's just a warning.
OptionWhat it doesDefault
Recommended summary lengthLength from which the counter turns red. Accepts 20 to 200 characters72
Maximum field lengthThe field doesn't accept more than 200 characters200 (fixed)

The same length also works as the summary length warning when the repository requires Conventional Commits without commitlint (see Conventional Commits).

What Versora does in git

Nothing extra: the summary becomes the first line of the git commit -F - message.

Caveats and messages

  • "Enter a whole number between 20 and 200.": the value typed in Recommended summary length is out of range.
  • A title length limit set by the team (.versora.yml) or by the company isn't a warning: a message that goes past it isn't committed. In that case, Preferences › Commit shows "In this repository, the commit title has at most 72 characters (team rule (.versora.yml))." See Team rules in the commit box.
  • Preferences › Commit › Message › Recommended summary length.
  • .versora.yml: commit.title_max and commit.title_min; company policy: commit_title_max (see The .versora.yml file).

See also

Description: automatic wrapping and expanded editor

The description is the body of the commit. Versora wraps the line on its own at column 72 as you type, as git convention asks, without touching code, trailers and long addresses. For longer texts, the expanded editor shows a ruler at the column and the cursor position.

Where to find it

  • Commit box › Description (optional) field.
  • Expanded editor: the button in the corner of the field, "Expand the description editor".
  • Preference: Preferences › Operations › Commit › Hard wrap the body.
  • Palette (Ctrl+P): "Operations preferences".

Step by step

  1. Write in Description (optional). When a line goes past the column, it's wrapped at the last space before it. The cursor stays where it is.
  2. For a long text, click "Expand the description editor". The Commit description window opens, with a monospaced font and a vertical ruler at the wrap column.
  3. At the bottom of the window you see "Line 3, column 18 · longest line: 64 of 72". The longest line is highlighted when it goes past the column.
  4. If you pasted a text with lines of varying lengths, click Reflow paragraphs ("Joins the lines of each paragraph and wraps them again at 72 columns").
  5. Click Done, press Esc or Ctrl+Enter to go back to the commit box. Inside the expanded editor, Ctrl+Enter only closes the editor; it doesn't commit.
OptionWhat it doesDefault
Wrap the commit body automaticallyWraps the line that goes past the column at the last space, as you typeOn
Wrap columnColumn for wrapping and for the expanded editor's ruler. Accepts 40 to 200 columns72
Hard wrap at 72 columns (in the expanded editor)The same option, turned on and off right thereThe preference's value
Reflow paragraphsJoins the lines of each paragraph and wraps them again at the columnButton

What wrapping does not touch:

  • code lines (that start with 4 spaces or a tab);
  • trailers, such as Signed-off-by: … and Co-authored-by: …;
  • words longer than the whole line, such as long addresses.

Reflow paragraphs treats blank lines as paragraph breaks and keeps list items (- item, * item, 1. item) at the start of the line, with the continuation aligned to the item's text.

With wrapping off, the border of the Description (optional) field changes color when a line goes past the column, so you can wrap it by hand.

What Versora does in git

Nothing extra. Wrapping only replaces spaces with line breaks in the text, before the commit. The whole message goes in git commit -F -.

How to undo

Automatic wrapping and Reflow paragraphs change the field's text. There's no button to go back to the previous text: check the result before Done. To avoid wrapping, turn off Hard wrap at 72 columns before pasting the text.

Caveats and messages

  • "Use a number between 40 and 200.": the Wrap column value is out of range; the previous value stays in effect.
  • Preferences › Operations › Commit › Hard wrap the body: Wrap the commit body automatically and Wrap column.

See also

Commit options: skip hooks and push after committing

The Commit options block brings together two choices: running the commit without git hooks and pushing right after the commit. Collapsed, it shows the active options next to the title, for example "without hooks · push after commit".

Where to find it

  • Commit box › Commit options (click the title to open or collapse it). The app remembers whether you left it open.
  • Push after commit is also in Preferences › Commit › Message.

Step by step

  1. Click Commit options.
  2. To not run the hooks for this commit, check Skip Git hooks. Next to it, the app shows which hooks are active in the repository, for example "— active: pre-commit, commit-msg", or "— no commit hooks active here".
  3. To push the commit as soon as it's created, check Push after committing.
  4. Check the button's text: Commit 2 files without hooks and push.
  5. Commit as usual.
OptionWhat it doesDefault
Skip Git hooksgit commit --no-verify: doesn't run the pre-commit and commit-msg hooks. Applies to one commit only: once a commit is created, it's unchecked again. If the commit fails, it stays checkedUnchecked
Push after committingPushes the branch right after the commit; publishes the branch if it isn't on the remote yet. It's the same option as in Preferences › Commit: checking it here leaves it checked for the next commits, in all repositoriesUnchecked
Preferences › Commit › Push after commit › Checked by defaultLeaves Push after committing checked by defaultOff

What Versora does in git

bash
# Skip Git hooks
git commit -F - --no-verify

# Push after committing (the usual push, with the checks before pushing)
git push
# branch without upstream: the app asks for the remote and publishes the branch
git push -u origin feature/login
# amend of a commit that was already on the remote: force push, with confirmation
# (--force-if-includes is added when the git version supports it)
git push --force-with-lease --force-if-includes

The list of active hooks comes from the repository's hooks folder (honoring core.hooksPath): the app looks for pre-commit and commit-msg.

How to undo

  • Skip Git hooks doesn't record anything: just uncheck it.
  • The push done by Push after committing isn't undone with Ctrl+Z: the commit is already on the remote (see How to undo in "Write and record a commit").

Caveats and messages

  • Skip Git hooks only skips git hooks. Versora's own checks (team rules, commitlint, secrets, protected branch…) keep running.
  • With an amend of a commit that was already on the remote, Push after committing does a force push and asks for confirmation first ("Overwrite origin/feature/login with your local feature/login? Uses --force-with-lease: fails if the remote has commits you haven't fetched yet.").
  • The push goes through the checks before pushing ("Before pushing"); see Push.
  • Preferences › Commit › Message › Push after commit.
  • Skipping hooks on push, pull, merge and rebase: see Push.

See also

When the commit is rejected: the hook output

When git rejects the commit (usually a pre-commit or commit-msg hook that found a problem), Versora doesn't just show a passing notice: the whole output stays in the commit box until you dismiss it. It's what tells you what needs fixing.

Where to find it

  • Commit box › Commit options: the block opens on its own and shows "The commit was not created", with the git and hook output right below.

Step by step

  1. Read the output. It comes without color codes; if it's long, the box scrolls.
  2. To keep it or send it to someone, use the Copy output button ("Output copied" appears).
  3. Fix what the output points out (for example, run the formatter or adjust the message) and commit again. The message stays in the box.
  4. If the hook doesn't apply to this commit, check Skip Git hooks and commit again.
  5. To take the box off the screen, click Dismiss (the X).

What Versora does in git

The same git commit -F - as always. The output shown is what git and the hook wrote. Before showing it, the app checks again which hooks are active (the hook may have changed).

How to undo

Nothing was recorded: the commit doesn't exist and the staging area stays as it was.

Caveats and messages

  • "A hook is active (pre-commit): fix what the output points out and try again, or check "Skip Git hooks"." (or "Hooks are active (pre-commit, commit-msg): …"): the commit was attempted with the hooks on, and they may be the cause.
  • "Commit signing failed. Check the key and format in Preferences › Commit.": git couldn't sign. The link opens Preferences › Commit; see Commit signing.
  • A missing identity (user.name/user.email) doesn't become output in the box: the app opens the "Git identity not configured" dialog.

See also

Commit box keyboard shortcuts

The shortcuts take you to the message and record the commit without taking your hands off the keyboard.

Where to find it

  • Shortcut help: F1 or Ctrl+/.
  • To change the keys: Preferences › Keyboard shortcuts (see Shortcuts and keymap).
Default shortcutName in the keymapWhat it doesWhere it works
Ctrl+Shift+M"Go to the commit message"Shows the changes panel (if another commit was selected), puts the focus on the Commit summary and selects its textAnywhere in a repository tab
Ctrl+Enter"Commit (from the commit message)"Commits, like the buttonWith the focus in a field of the commit box
Ctrl+Shift+Enter"Stage all and commit"Stages everything and commitsIn the commit box or outside any text field
Alt+I"Add the issue reference to the message"Adds the branch's issue reference (see the next section)With the changes panel open and no dialog open

Step by step: stage all and commit

  1. Write the summary (or leave it for later: see step 3).
  2. Press Ctrl+Shift+Enter.
  3. Without a message, nothing is done, not even the staging: the focus goes to the summary and "Write the commit message first (Ctrl+Shift+M takes you there)." appears.
  4. With a message, the app stages everything in Unstaged files and in conflict (except the "don't commit" list) and commits, with the same checks as the button.

What Versora does in git

bash
git add -A        # the "Stage all changes"; with the "don't commit" list, only the other files
git commit -F -

How to undo

Ctrl+Z undoes the commit and leaves everything staged, including what the shortcut put there. To unstage it, use Unstage all changes (Ctrl+Shift+U). With a merge in progress, the commit concludes the merge, and Ctrl+Z undoes the entire merge, as described in How to undo, at the start of this page.

Caveats and messages

  • Files still have conflict markers: with conflicted files, Ctrl+Shift+Enter does the same as the Stage all changes button. If any of them still has markers (<<<<<<<), the same confirmation appears ("Staging marks the conflicts as resolved with the markers inside the files. Stage everything anyway?"), with the Stage anyway button. If you give up, nothing is done, not even the commit. A conflicted file that you've already resolved on disk (without markers) is staged without a question. See Staging.
  • If, after staging, the button is still disabled, the app shows the button's text in a notice (for example "Type a message to commit").
  • The single-key staging shortcuts (S, U) don't fire with the focus in a text field; see Staging.
  • Preferences › Keyboard shortcuts: change any of these shortcuts.

See also

Add the issue reference (Alt+I)

When the branch name mentions an issue (feature/123-login, PROJ-123-login), the commit box shows a button that puts the reference in the message: Closes #123 at the end of the description (GitLab and GitHub) or PROJ-123 at the start of the summary (Jira).

Where to find it

  • Commit box › the button with the reference text (for example Closes #123), with the "Alt+I" hint next to it.
  • Shortcut: Alt+I.

Step by step

  1. Work on a branch linked to an issue (see Issues).
  2. Write the message.
  3. Click the reference button or press Alt+I. The button's tooltip says where it will put the text: "Add "Closes #123" at the end of the description (Alt+I)" or "Add "PROJ-123" at the start of the summary (Alt+I)".
  4. After that, the button is disabled and shows "#123 in message" (tooltip: "The message already references #123"). The reference isn't written twice.

The format and the place are in Preferences › Issues › Reference in the commit message, per repository:

OptionValuesDefault
Reference formatCloses {ref}, Refs {ref} or just the keyGitLab/GitHub: Closes #123; Jira: the key
Where to add the referenceAt the start of the summary or At the end of the descriptionGitLab/GitHub: at the end of the description; Jira: at the start of the summary

What Versora does in git

Nothing extra: the text goes into the message before the commit. "Closes" closes the issue when the commit reaches the default branch (that's GitLab's and GitHub's doing).

How to undo

Delete the text from the message before committing.

Caveats and messages

  • With a dialog open, Alt+I doesn't touch the message underneath it.
  • The button disappears when the branch doesn't mention an issue or when the issue doesn't exist.

See also

Team rules in the commit box

When the repository has a .versora.yml with message rules, or the company has set rules for the computer, the commit box shows a strip with the rules in effect and, while you write, what the message doesn't meet yet. A message outside these rules isn't committed: there's no "commit anyway".

Where to find it

  • Commit box › the strip above the commit button (label for screen readers: "Rules for this repository").
  • See rules, on the strip, opens Preferences › Policy and team.

Step by step

  1. Read the strip: it sums up the rules, for example "title up to 72 · Conventional Commits · types: feat, fix, docs". When no summary is possible, "team rules in effect" appears.
  2. Write the message. A moment after you stop typing, the strip lists up to three problems, for example "The title has 81 characters; the maximum is 72.".
  3. If the rule requires Signed-off-by, the strip says "Signed-off-by will be added (team rule (.versora.yml))." You don't need to write it.
  4. If the team asks for the trailer for code made with AI, answer on the strip (see AI co-authorship trailer).
  5. Commit. If something is still outside the rules, the "The message doesn't follow the rules" dialog lists what to fix ("Fix the message and commit again:"), and the button is Fix the message.

The rules the strip shows (the configuration is in .versora.yml or in the company policy):

On the stripRuleMessage when not met
"title up to 72"Maximum title length"The title has 81 characters; the maximum is 72."
"title of 10 or more"Minimum title length"The title has 6 characters; the minimum is 10."
"Conventional Commits"Conventional Commits required"The title doesn't follow Conventional Commits (type(scope): description)."
"types: feat, fix, docs"Allowed types"The type chore isn't one of the allowed ones: feat, fix, docs."
"title pattern"Expression the title has to match"The title doesn't follow the pattern ^[A-Z]+-\d+ ." or the team's hint with the pattern
(Signed-off-by line)Signed-off-by requiredThe app adds it when committing

Messages that git writes itself (merge, revert, fixup!, squash!, amend!) go through without being checked.

What Versora does in git

The check is done by the app. Signed-off-by and the AI trailer go into the message before the commit:

bash
git interpret-trailers --if-exists addIfDifferent \
  --trailer "Signed-off-by: Ana Souza <[email protected]>"
git commit -F -

How to undo

Nothing is recorded while the message doesn't meet the rules. After the commit, the usual Ctrl+Z applies.

Caveats and messages

  • "Checking the team rules failed: …": the check ran into an error and the commit goes ahead; the notice is only informative.
  • "Couldn't add the trailers to the message: …": usually, the identity is missing ("No git identity (user.name and user.email): Signed-off-by can't be written."). The commit is canceled.
  • "Protected branch": with protected_mode: block, a direct commit to a protected branch is rejected ("main is protected and doesn't accept direct commits (…). Create a branch for your work and open a merge request."). See Checks.
  • Preferences › Policy and team: the rules in effect and where each one came from.
  • .versora.yml (the commit: key) and the company policy (commit_title_max, commit_conventional, commit_types, commit_signoff, ai_coauthor, ai_trailer). Each level can only tighten the one below it. See The .versora.yml file.

See also

Checks before the commit and identity warning

When you click commit, Versora runs the checks before calling git, in a fixed order: first the team and company rules, then the push rules, the identity and the message rules, and last the others (CI, secrets, large files, protected branch, line endings…). A check that cancels the commit ends the sequence: the following ones don't even get to ask. The remaining warnings show up together in a dialog, which lets you go back or go ahead.

Where to find it

  • They run on their own with every commit. The bar shows "Checking before commit…".
  • The Commit as line in the commit box: the email that goes into the commit and where it comes from (for example "global", "this repository" or "rule Company"). It turns yellow when there's something to check. Clicking it opens Preferences › Identities.

Step by step

  1. Commit as usual.
  2. If a dialog shows up, read which check each item comes from (the group title says so, for example "Commit message (Conventional Commits)" or "Line endings").
  3. Fix it and commit again, or go ahead with the dialog's button (Commit anyway), when the check allows it.

What is checked and where it's explained:

CheckWhat it looks atPage
Team and company rulesTitle, Conventional Commits, types, Signed-off-by, AI trailer, protected branch with blockingTeam rules in the commit box
Push rulesThe GitLab rules, the .versora/push-rules.json rules and the local ones ("Before committing: push rules")Checks
IdentityName and email that go into the commit ("Before committing: identity")Identity
Commit messageThe repository's commitlint or required Conventional CommitsConventional Commits
CI validationThe staged .gitlab-ci.yml ("CI validation (.gitlab-ci.yml)")Pipelines
Secrets, large files, protected branchWhat is staged ("Before committing")Checks
Line endingsCRLF or mixed line endings going into the commitChecks
Message templateThe message is the same as commit.template (as it is in the file or with the variables replaced), with nothing filled inTemplates
"Don't commit" listA file on the list is stagedThe "don't commit" list

The identity warning

  • Without a name and email, "Git identity not configured" shows up before the commit is attempted.
  • When an identity rule matches the repository but another setting overrides it, or when the repository belongs to the company and the email isn't from its domain, the "Before committing: identity" dialog shows up, with "The commit would be made as" and the options Use the identity of the "Company" rule in this repository (or Create rule…), Commit anyway and Back.
  • Details in Identity: name and email.

What Versora does in git

The checks read the repository (configuration, what is staged) and, depending on the case, the GitLab or GitHub API. They don't record anything, except when you choose a fix (for example, saving the rule's identity in the local configuration, with the command shown beforehand).

How to undo

Going back in a dialog cancels the commit; nothing changes in the repository.

Caveats and messages

  • "Before committing" with Commit anyway: these are warnings; you decide.
  • "The message doesn't follow the rules" and "Message breaks the rules": these are blocks; only Fix the message.
  • A check that fails because of an internal error doesn't stop the commit.
  • Preferences › Checks, Push rules, Identities, Versions and commits, Operations (line endings).

See also