GNU TeXmacsUser manualReferenceAboutEnglish
Comparing and restoring versions
Comparing the document with another version

The submenu Version\(\rightarrow\)Compare with compares the current document with:

Last commit

the version of the last commit, that is, it shows what you changed since then (also ⌘⌃#=);

Staged version

the version which you staged;

Remote version

the version on the server, as known after the last exchange;

Before the last pull or merge

the version before the changes of your coauthors were merged, that is, it shows what they changed;

Other revision

any revision, given by the name of a branch or a tag, or the identifier of a commit;

Tag …, Branch …

the version of a tag or of another branch;

and, below, with each of the recent versions of the document.

The differences are shown inside the document itself, with the old version in red and the new version in green, as when comparing two files. A bar at the bottom of the window shows the number of differences, with buttons for going to the previous or next one, for keeping the old or the new version of the current difference, and for choosing which versions are displayed. The bar can be closed and reopened with Version\(\rightarrow\)Differences\(\rightarrow\)Review bar. The keyboard shortcuts of Version\(\rightarrow\)Differences can be used as well.

When you are done, the document contains the versions which you kept. Save it to make the result permanent, or close it without saving to forget the comparison.

The history of the document

Version\(\rightarrow\)History of this document shows the list of the commits which changed the document, with their authors, dates and messages. The history follows the document when it is renamed. Each version can be opened as a read-only document. When viewing such an old version, Version\(\rightarrow\)Compare with\(\rightarrow\)Current user version compares it with the current one, and Version\(\rightarrow\)Restore this version puts it back.

Restoring an earlier version

Version\(\rightarrow\)Restore version lists the recent versions of the current document. Choosing one of them replaces the contents of the file by that version. The history is not modified: this is an ordinary change, which you may compare with the last commit, commit or discard. However, the changes of the file which were neither committed nor staged are lost, and TeXmacs warns you about this before restoring; commit them first if you want to keep them. A document with unsaved edits has to be saved or reverted first. Recent versions can also be compared and restored from the History tab of the Git panel.

To put back the state of the whole project, use the snapshots of the simple mode.

Who changed what

Version\(\rightarrow\)Who changed what shows the document with, before each paragraph or group of paragraphs, the commit which last changed it: its author, its date and its message. Each author is shown in a color of their own, and a legend at the top tells how many paragraphs each author last changed. Paragraphs which were changed since the last commit are marked as not committed.

Unlike the git blame command, which works line by line on the source file, TeXmacs follows the paragraphs of the typeset document through its history, so that the result is not disturbed by changes in the layout of the source. Only the most recent commits are examined (30 by default, see the preferences); older paragraphs are then marked accordingly. This command is not available while the document has a conflict.

The history of the repository

Version\(\rightarrow\)Git\(\rightarrow\)History lists all commits of the current branch, and Version\(\rightarrow\)Git\(\rightarrow\)Graph shows the history of all branches as a graph, with the names of the branches and tags. Clicking on a commit opens its page, with its author, date, message and the list of files which it changed, together with the size of the changes. From this page, you can open a file as it was in that commit, or compare a TeXmacs document with its current version.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".