Windows
Command line
7 min read
Versora's executable also works as a terminal command. You're in PowerShell, Command Prompt or Git
Bash, inside a repository, and want to see a file's blame, a folder's history or the diff between
two branches: a versora command opens the right screen in the app, without searching for
anything in the interface.
Paths and revisions are relative to the terminal's current folder, as in git. The screen opens in Versora, in the window that's already open, if there is one. If Versora is closed, the command itself opens the app, with the request already in place.
| Command | What it opens |
|---|---|
versora [FOLDER] | The folder's repository. With no folder, just opens the app. |
versora blame FILE [LINE] | The file's blame, right at the line. Also accepts FILE:LINE. |
versora log [PATH] | The history of the repository (no path), of a file or of a folder. |
versora show COMMIT | The commit in the graph, with the details in the right panel. |
versora diff A B | The diff between two revisions. Also accepts A..B and A...B. |
versora versora://… | A Versora link (see versora:// links). |
versora mergetool BASE LOCAL REMOTE MERGED | Resolves the conflict in Versora's editor (git mergetool). |
versora difftool LOCAL REMOTE [MERGED] | Shows the diff in Versora (git difftool). |
| Option | What it does |
|---|---|
-h, --help | Shows the help. -?, /? and help also work. |
-v, --version | Shows the version (Versora X.Y.Z). -V also works. |
--lang <pt-BR|en|es> | Language of the terminal messages. The default is Versora's interface language. |
The mergetool and difftool commands are called by git, not by you. They're covered in
git mergetool and git difftool.
Opens the folder's repository in a tab. It's the same as the "Open with Versora" item in File Explorer.
- In a terminal, go into the repository folder:
cd D:\dev\loja-web. - Type
versora .and press Enter. - The repository opens in a tab (or its tab is activated).
A subfolder of the repository works too: Versora goes up to the root. A word that's neither a
folder nor a command (such as versora blam x, with a typo) is rejected with "Unknown command:
…", so that the app doesn't silently open while ignoring the request.
Opens the file's blame, already scrolled to the requested line.
versora blame src\carrinho.ts
versora blame src\carrinho.ts 42
versora blame src\carrinho.ts:42
- The file must exist on disk and be tracked by git.
- Lines start at 1.
- The blame is of the working directory version.
versora log # the repository's history (the graph)
versora log src\carrinho.ts # the file's history
versora log src\api # the folder's history
- With no path, opens the repository in the graph.
- With a file, opens the File history.
- With a folder, opens the Folder history.
- A file that has already been deleted from disk also works, if it shows up in the history.
- For a path that starts with
-, put--before it:versora log -- -estranho.
versora show 3f2a9c1
versora show HEAD~2
versora show v2.4.0
Selects the commit in the graph and shows its details. Accepts any revision git understands: SHA,
branch, tag, HEAD~2.
versora diff main feature/pagamento
versora diff main..feature/pagamento
versora diff main...feature/pagamento
Opens the inspection's comparison screen (see Compare):
A BandA..Bshow the direct difference between the two revisions, likegit diff A B.A...Bshows whatBhas since the point where it split fromA. The left side becomes the merge base, with the label "merge-base of A and B".- An empty side means
HEAD:versora diff main..comparesmainwithHEAD.
The help lists the commands, the options, the git config commands that set Versora up as a git
tool and the exit codes. It comes out in Versora's interface language, or in the one from
--lang. In English, it starts like this:
Versora X.Y.Z: Git client
Usage:
versora [FOLDER] Opens the folder's repository (no folder: just the app)
versora blame FILE [LINE] Blame of the file, at the line (also FILE:LINE)
versora log [PATH] History of the repository, a file or a folder
versora show COMMIT The commit in the graph, with its details
versora diff A B Diff between two revisions (also A..B and A...B)
versora versora://… Opens a Versora link
versora mergetool BASE LOCAL REMOTE MERGED Resolves the conflict in Versora's editor (git mergetool)
versora difftool LOCAL REMOTE [MERGED] Shows the diff in Versora (git difftool)
Paths and revisions are relative to the terminal's current folder. The screen opens in Versora (in the window that's already open, if any).
Options:
-h, --help Shows this help
-v, --version Shows the version
--lang <pt-BR|en|es> Language of the messages (default: Versora's interface language)
Then come the git config commands that set Versora up as git mergetool and git difftool
(with the path to your versora.exe) and the exit codes, described below.
Tip
In Command Prompt and PowerShell, the output of versora --help shows up after the prompt,
because Versora is a windowed app and those terminals don't wait for it to finish. Press
Enter to get the prompt back. In Git Bash and in git, the output comes out normally.
| Code | Meaning |
|---|---|
0 | Done. For mergetool, the conflict was resolved. |
1 | Not resolved, canceled, or Versora didn't answer. |
2 | Wrong usage, invalid path or revision. |
This way, a script can check the result. Usage errors show up in the terminal itself.
To type just versora in any terminal, the Versora folder needs to be on the PATH.
- Preferences › Command line and links › Command line group › Executable.
- Palette (Ctrl+P): "Command line, links and git mergetool…".
-
Open Preferences › Command line and links.
-
Under Executable, see the path of
versora.exeand the status:- "Versora's folder is in PATH: the versora command works in any new terminal.";
- or "Versora's folder isn't in PATH. Use the full path, or add the folder to your user PATH with the PowerShell command below (then open a new terminal).".
-
If it isn't, click Copy command. The copied command is of this kind:
[Environment]::SetEnvironmentVariable('Path', [Environment]::GetEnvironmentVariable('Path', 'User') + ';<Versora folder>', 'User') -
Paste and run the command in PowerShell. It adds the folder to your user's PATH, without asking for administrator rights.
-
Open a new terminal and test it with
versora --version.
The Show the help (versora --help) button shows the full help right there, in Preferences. Hide the help closes it.
Versora doesn't write the PATH: the command you ran does. To remove the folder, edit your user's
Path variable in the Windows environment variables and delete the part with the Versora folder.
The actions of the File Explorer submenu also work in the terminal, with a single path that exists:
versora blame src\carrinho.ts
versora log src\carrinho.ts
versora diff-head src\carrinho.ts # Diff with the last commit
versora open src\carrinho.ts # Open the repository in Versora
diff-head and open belong to the submenu only: the command line's diff compares two
revisions, and "Diff with the last commit" is something else. In these two actions, the warnings
show up in the app, not in the terminal.
- "Unknown command: …. See versora --help.": the first word is neither a command nor an existing folder.
- "Unknown option: …. See versora --help.": an option the command doesn't have.
- "Missing …. See versora --help.": an argument is missing, such as
blame's FILE,show's COMMIT ordiff's B. - "Unexpected argument: …. See versora --help.": there's an argument too many. Put paths with spaces in quotes.
- "Invalid line: … (use a number from 1).":
blame's line must be a number from 1. - "Unknown language: … (use pt-BR, en or es)." and "Missing the language after --lang (pt-BR, en
or es).": a problem with
--lang. - "Couldn't find ….": the path doesn't exist relative to the terminal's current folder.
- "… isn't in a git repository.": the current folder (or the path) isn't inside a repository.
- "… is a folder: blame works on a file.": use
versora logfor folders. - "… isn't in git (new or ignored file): there's no blame.": commit the file first.
- "Revision not found: ….": git doesn't recognize the revision. Check the name or fetch.
- "… and … have no commit in common.": in
A...B, the two revisions have no merge base. - "Versora refused the request: …" and "Versora didn't answer: …": the open window couldn't handle it.
- "Couldn't open Versora: …" and "Versora didn't open in time. Open the app and try again.": the app didn't open to receive the request.
- "A Versora version without command line support is open. Close it (or update it) and try again.": the open window is from an old version. Close it or update Versora.
- Preferences › Command line and links shows the executable, the PATH and the help.
- The page can be hidden or made read-only by the company policy, with the id
deeplink. See Policy keys.