Skip to content
Versora

Manual

Inspection

Revision tree and ZIP export

6 min read

On this page

Tree of any revision

The tree shows every file and folder of a revision (commit, branch or tag), not just the changed ones. You can open any file from that version with syntax highlighting, see its history and blame, and save a copy, without a checkout and without touching the working directory.

Use the tree to check what a configuration file looked like in an old tag, look for a file that was deleted later, or pick up a file from another branch for reference.

Where to find it

  • A commit's menu: Browse the files of this commit.
  • Menu of a branch (local or remote) or of a tag: Browse the files of <name>.
  • Right panel, in a commit's details: View all files button ("Opens the full tree of this revision: every file, not only the changed ones").
  • Blame: right-click a block › Browse the tree of this version, which opens the file right away.
  • Treemap: right-click an item › Show in the revision tree.
  • Insights, with a folder or file in focus: Open in tree button.
  • Palette (Ctrl+P):
    • "Browse the files of <current branch>" ("The revision tree, with the content, history and blame of each file");
    • "Browse the files of a revision…", which asks for the Revision ("A branch name, a tag or a commit SHA.") and opens it with Open.

Step by step

  1. Right-click the v1.4.0 tag and choose Browse the files of v1.4.0.
  2. The tree opens in the central area. The header shows the revision and the commit's author and date.
  3. Browse the folders with the mouse or the keyboard (arrows to open and close folders).
  4. To find a file, type part of its name in Find a file by name. The list shows how many were found.
  5. Click a file to see its content on the right, with the name and the size. In a Markdown file, switch between Preview and Code.
  6. Use the file's buttons:
    • File history ("Commits that changed this file up to this revision");
    • Blame ("Who wrote each line in this revision");
    • Save as… (icon), which writes the file from that version wherever you choose.
  7. Right-click a line of the content for Investigate the origin of line N… or Blame this version.
  8. To see another revision, use Change revision…. To go to the commit, Go to commit ("Closes the tree and shows the commit in the graph"). To close, the X or Esc.

Tree menus

Right-click a folder:

ItemWhat it does
Export this folder as ZIP…Opens the export with the folder already chosen.
Contributors of this folderOpens the insights for that folder only.
Activity of this folderOpens the activity over time for that folder only.
Folder historyOpens the folder history: the commits that touched anything inside it up to this revision, with only the folder's files in each commit.

Right-click a file:

ItemWhat it does
OpenShows the content on the right.
File historyOpens the file history up to this revision.
BlameOpens the blame at this revision. Only for regular files.
Visual history of this fileOpens the activity over time for this file only.
Save as…Saves the file from this revision. Disabled for submodules.

What Versora does in git

The tree only reads git objects; the working directory isn't touched:

bash
git ls-tree -z -l <revision>:<folder>            # contents of a folder, with sizes
git ls-tree -r -z --name-only <revision>        # every path, for the search by name
git cat-file blob <revision>:<file>             # contents of a file (also for Save as…)

How to undo

Nothing to undo: the tree doesn't change the repository. Save as… only creates the file you chose.

Caveats and messages

  • "Pick a file in the tree to see its content in this revision.": no file is open yet.
  • "Binary file: the content isn't shown.": use Save as… to get the file. Images are shown.
  • "File too large to show here.": text above 4 MB (and images above 12 MB) doesn't appear on screen, but can be saved.
  • "Submodule: in this revision it points to commit <sha>.": the entry is a submodule. See Submodules.
  • "Git LFS file: the repository only stores the pointer below; the content lives on the LFS server.": the tree shows the pointer, not the content. See Git LFS.
  • "Symbolic link to <target>": the entry is a symlink; it appears with the link badge.
  • "Empty file.": the file exists, but has no content.
  • "The first N files found (refine the search)": the search stops at 300 results.
  • "No file with that name in this revision": no path contains the text you typed.
  • "File saved to <path> (<size>).": confirmation of Save as….
  • "The file "<path>" doesn't exist in revision <sha>." and ""<path>" isn't a folder in this revision.": the requested path doesn't exist in that revision.
  • "The repository has no commits yet": the palette makes the command unavailable.

Export ZIP or tar.gz

Creates a compressed file with the content of a revision, or of one of its folders, without the git history. It's useful for handing a version's code to someone who doesn't use git, attaching it to a ticket, or keeping a copy of a release.

Where to find it

  • A commit's menu: Export this commit as ZIP…
  • Menu of a branch or of a tag: Export <name> as ZIP…
  • Revision tree: Export ZIP… button in the header, or right-click a folder › Export this folder as ZIP….
  • Palette (Ctrl+P): "Export <current branch> as ZIP…" ("git archive of the whole revision or of a folder (ZIP or tar.gz)").

Step by step

  1. Right-click the v1.4.0 tag and choose Export v1.4.0 as ZIP….
  2. Under Content, choose The whole revision or Only a folder. For a folder, type its path in the revision, for example src/lib.
  3. Under Format, choose ZIP or tar.gz.
  4. Click Choose where to save…. The Save the exported file window suggests the name <repository>-<revision>[-<folder>].<format>, for example loja-v1.4.0.zip.
  5. Follow "Exporting…" with the progress bar ("N of M entries written"). Cancel stops it.
  6. At the end, the notice "Exported to <path> (<size>, N entries)." has the Show in folder button.
OptionWhat it doesDefault
The whole revisionExports every file in the revision.Selected (or Only a folder, when opened from a folder)
Only a folderExports only the folder you entered.—
ZIP / tar.gzFile format.ZIP; your choice is remembered

Inside the file, everything goes into a folder named after the repository and the short SHA. Anything marked export-ignore in .gitattributes is left out.

What Versora does in git

bash
git archive -v --format=zip --prefix=<repository>-<sha>/ -o <temporary-file> <sha> [-- <folder>]

The file is written under a temporary name next to the destination and only gets the chosen name at the end. That way, canceling or failing midway doesn't leave a half-written ZIP or damage a file that already existed with that name.

Example .gitattributes to leave files out of the export:

.gitlab-ci.yml  export-ignore
testes/         export-ignore

How to undo

The export doesn't change the repository. To undo it, delete the generated file.

Caveats and messages

  • "Export canceled; no file was written.": you canceled. Nothing is left half-done.
  • "Choose a valid destination file (full path, in an existing folder): <path>" and "The destination is a folder: <path>": the chosen destination won't work.
  • ""<folder>" isn't a folder in this revision.": the Only a folder path doesn't exist in that revision.
  • "Couldn't write <path>: <error>": there's no permission or no space at the destination.

The tree and the export have no preference of their own and no company policy key.

See also