Checks
Checks before commit and push
4 min read
Before every commit and every push, Versora checks what's about to leave your machine: secrets and sensitive files, large files outside Git LFS, a commit or push to a protected branch, the GitLab push rules, the CI file and the team rules. The goal is for the problem to show up earlier, on your screen, and not later, as a push rejected by the server or a token leaked into the history.
The checks never block your work on their own because of an error of theirs: if one fails, the app tells you and moves on. You decide, with … anyway or Back. The exception is the rules the team or the company made mandatory (see below).
| Check | On commit | On push | Page |
|---|---|---|---|
Team rules (.versora.yml) and company rules | message, protected branch in block mode | protected branch in block mode | Protected branches |
| Push rules | message, identity, signature, Signed-off-by, files | commits not pushed yet, name of the new branch | Push rules |
| CI validation | the staged .gitlab-ci.yml (or a local include) | the commits that change the CI | Validating CI |
| Secrets and sensitive files | the staged added lines | the commits the remote doesn't have yet | Secrets |
| Large files | staged files over the limit, outside LFS | — | Large files |
| Protected branch | direct commit to a protected branch | direct or force push to a protected branch | Protected branches |
| Line endings | CRLF or mixed line endings going into the commit | — | Warnings |
Before a merge and a rebase (from the menu or by dragging a branch), the app also checks whether the operation will conflict. See Conflict prediction and, for all the details, Predicting conflicts before operating.
The checks run one after another, in this order:
- team and company rules;
- push rules;
- CI validation;
- secrets, large files and protected branch (a single dialog);
- the other commit checks (Conventional Commits and commitlint rules, identity by folder, unedited message template, "don't commit" list; see Commits);
- last, line endings.
If you give up in a dialog, the following checks don't even run. While they run, the repository bar shows "Checking before commit…" or "Checking before push…" (and, at each step, texts such as "Checking before committing…" or "Checking push rules…").
It opens with the title Before committing (or Before pushing) and a line that says what's being checked: "In the changes staged for the commit on main:" or "Pushing feature/login to origin/feature/login — 3 commits not pushed yet:". Each finding comes with the action that resolves it:
- for a secret, Ignore this finding;
- for a large file, Track with LFS or All *.mp4;
- for a commit to a protected branch, the field for the name of a new branch and Create branch and commit there.
The main button changes depending on what's left: Commit (or Push) when everything was resolved, Commit anyway (or Push anyway) when there are still findings. Back cancels the operation. Esc also goes back. While the dialog is open, the app's Ctrl+Z is turned off, so it doesn't touch what's being checked.
Findings that don't have a dialog of their own (such as line endings) go to a dialog with the list grouped by check: Before committing with Commit anyway, or Before pushing with Push anyway, and Cancel. Serious findings appear with ⚠.
Push rules and CI validation open their own dialogs, with the fixes each one offers. See Push rules and Validating CI.
To check the staged changes before you decide on the commit:
- Palette (Ctrl+P): "Check staged changes" (detail: "Secrets, sensitive files and large files, without committing").
If something is found, the Staged changes check dialog opens ("Found in the changes staged for the next commit:"), with the same actions. If nothing is found, you see "Nothing found in 4 staged files." With nothing staged, "Nothing is staged to check." (and the command is unavailable in the palette: "nothing is staged").
- Preferences › Checks: secrets, sensitive files, engine (Versora rules or gitleaks), large files and the limit, protected branches, conflict prediction. At the end of the page, Restore defaults resets the general options to their defaults (the per-repository ones are kept).
- In this repository, on the same page: the protected branch list, the conflict prediction target and Checks enabled here (Secrets and sensitive files, Large files, Protected branches, Conflict prediction). Turning one off there only affects the repository.
- Preferences › Push rules and Preferences › CI validation: the checks of each one.
- Preferences › Operations › Warnings: line endings and the git version.
- Palette: "Preferences: checks".
secrets_scan(machine policy): locks the secrets check on (required) or off (off). The Checks page shows "Secret scanning is set by your company: always on, on commit and on push." and your own choice, including per repository, no longer applies.protected_branches(machine policy) andbranches.protected(the team's.versora.yml): add branches to the protected list. With them, the protected branch check applies even if it's turned off in the repository.branches.protected_mode: block(.versora.yml): a direct commit and push to a protected branch are rejected, with no "anyway".
The details are in Administrators and in Protected branches.