GNU TeXmacsUser manualReferenceAboutEnglish
Recording changes

In Git, a commit records the state of some files, together with a message which describes the changes, your name and the date. This page describes the full mode; in the simple mode, you rather save snapshots, which are commits of all files.

The commit dialog

Version\(\rightarrow\)Commit (or ⌘⌃#C) opens a dialog with:

Initially, the files whose changes were staged are selected (see below). If nothing was staged, then all changed files which are already under version control are selected; new files have to be selected explicitly. When the corresponding preference is set (it is by default), the message is also suggested from the start. Documents with unsaved changes are saved before the commit, since Git only records what is on disk. If the commit cannot be done, for instance because the message is empty, then the dialog stays open and explains why.

During a merge (see resolving conflicts), the dialog proposes the message prepared by Git and keeps all files selected, since a merge commit must contain all changes. It refuses to commit as long as some conflicts remain.

A quicker way of committing is to type a message in the box of the Git panel and to click on Commit: the staged changes are committed or, if nothing was staged, the changes of all files under version control.

The current file

The submenu Version\(\rightarrow\)This file contains the operations which apply to the current document. Only the entries which make sense in its current state are shown:

Add to repository

Put a new file under version control. It will be part of the next commit.

Stage changes

Mark the current changes of the file as part of the next commit.

Unstage changes

Undo the previous operation. The file itself is not modified.

Commit this file

Save the document and commit it on its own, after asking for a message.

Discard changes

Put back the version of the file which was last staged or committed, after a confirmation. The changes since then are lost, unless you saved them elsewhere.

Staging

Staging allows you to prepare a commit in several steps, and to commit some of your changes while keeping others for later. The staged version of a file is the version which will be recorded by the next commit. Besides Version\(\rightarrow\)This file\(\rightarrow\)Stage changes, you can stage files from the Changes tab of the Git panel, from the status page (Version\(\rightarrow\)Git\(\rightarrow\)Status), or all at once with Version\(\rightarrow\)Git\(\rightarrow\)Stage all changes. When a file is selected in the commit dialog without having been staged, all its changes are committed; when it was staged, it is committed exactly as it was staged.

If you do not want to deal with staging, then just select the files in the commit dialog.

Projects with several files

A document is often made of several files: included documents, images, bibliographies, style files. For TeXmacs documents, Version\(\rightarrow\)Project\(\rightarrow\)Commit project opens the commit dialog with all changed files of the project selected. If some of these files are not yet under version control, then Version\(\rightarrow\)Project also offers to add them; forgetting them is a common reason why a coauthor cannot typeset a document.

The status page

Version\(\rightarrow\)Git\(\rightarrow\)Status (or ⌘⌃#S) opens a page with the current branch, how many commits are waiting to be sent or received, and the lists of conflicts, staged changes, other changes and untracked files. Each file comes with buttons for comparing, staging, unstaging, discarding or adding it. The buttons at the top give access to the commit dialog, to the other pages (Log, Graph, Branches, Output) and to the exchanges with the server. The page is updated when you save a document; use Refresh after changing files outside TeXmacs.

Signing commits

If you use GnuPG, then your commits and tags can be signed, using Version\(\rightarrow\)Git\(\rightarrow\)Preferences\(\rightarrow\)Sign commits and tags or the preferences dialog. The page of a commit shows whether its signature is valid.

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".