GNU TeXmacsUser manualReferenceAboutEnglish
Branches, tags and stashes

The commands of this page are those of the full mode, in the submenu Version\(\rightarrow\)Git.

Branches

A branch is a line of development. Branches allow you to try out a change, such as a new structure for a chapter or the answer to a referee, without disturbing the main version, and to merge it later if you are satisfied. The current branch is shown in the footer, in the panel and in the name of the submenu Version\(\rightarrow\)Git.

New branch

Create a branch starting from the current version, and switch to it unless you uncheck the corresponding box.

Switch to branch

Put the files in the state of another branch. Your uncommitted changes are kept, unless they concern files which differ between both branches: Git then refuses, and you should first commit or stash your changes.

Merge branch

Merge another branch into the current one. Conflicts in TeXmacs documents are handled as when working with coauthors: if the merge stops, the dialog which explains it offers to show the status, from which the conflicts can be resolved.

TeXmacs offers to save your modified documents before switching or merging. The page Version\(\rightarrow\)Git\(\rightarrow\)Branches and tags lists the local branches and the branches of the remote repositories, with the date of their last commit and buttons for switching to them, merging them or deleting them. You can also switch to another branch from the Branches tab of the Git panel, and compare the current document with its version in another branch using Version\(\rightarrow\)Compare with.

Tags

A tag gives a name to a version, for instance submitted-v1 for the version which you sent to a journal. Version\(\rightarrow\)Git\(\rightarrow\)Tag this version asks for the name of the tag and an optional message. The tags are listed on the page Version\(\rightarrow\)Git\(\rightarrow\)Branches and tags and in the graph of the history, and the current document can be compared with its tagged versions using Version\(\rightarrow\)Compare with: this is a convenient way to produce the list of changes requested by a journal.

Stashes

A stash puts your uncommitted changes aside, and brings the files back to the state of the last commit; for instance, when you have to correct something urgently in a clean version. New files, which are not yet under version control, are not put aside. Version\(\rightarrow\)Git\(\rightarrow\)Stash changes creates a stash, and Version\(\rightarrow\)Git\(\rightarrow\)Restore last stash puts the changes back. The stashes are listed on the page Version\(\rightarrow\)Git\(\rightarrow\)Branches and tags, where they can also be restored or dropped.

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