Getting source code with Git

On this page... (hide)

  1.   1.  Introduction
  2.   2.  LyX Git Repository
  3.   3.  Source browser
  4.   4.  Anonymous Git clone
  5.   5.  After the first download
  6.   6.  Compiling the source
  7.   7.  Changing the source
  8.   8.  Write access via ssh
  9.   9.  Git Branches

1.  Introduction

Git allows multiple people to work on code development at one time. You can get a lot more information on Git and/or download the code from its home page.

For more detailed usage with LyX (or in case you want to start work on the code) please have a look at our wiki pages.

2.  LyX Git Repository

lyx.git
This repository hosts the LyX source code. The development of the forthcoming major release takes place in master branch and the minor (maintenance) releases are prepared in branches like 2.0.2. The forthcoming stable version resides in the most recent branch 2.0.x. According to old habits we sometimes call master branch trunk and maintenance branch simply as branch.
In Trac, you must use the "Visit" pull-down menu to select the branch that you wish to browse.

3.  Source browser

Using Git, you can download a whole repository with just one command. If you want to look at just one Git file, consider using source browser. Trac and Gitweb are tools that allow, among other things, for browsing an Git repository and gives the possibility to browse diffs between arbitrary versions as well as reading log files and the like.

Most probably, though, you want to download a Git repository. If so, read on.

4.  Anonymous Git clone

From within the directory where you want to place your local copy of the sources, do:

 git clone https://git.lyx.org/repos/lyx.git

This will make a directory lyx and download lots of files into that directory. (A fresh copy will need about 800MB. However, you will need a lot more space for the compiled version -- up to 2 GB). The old (way faster but less secure) protocol still works (git clone git://git.lyx.org/lyx) and is also the only way how to get different repositories stored on the git server, unless you are developer.

You can switch to maintenance branch via git checkout 2.4.x inside the lyx directory.

If you suffer from slow connectivity to our git server, the initial 1 GB download might be too slow. We offer mirrors of the initial clone, the details are here.

5.  After the first download

If the code is updated, just cd to the lyx directory and say:

 git pull

This will magically download or patch only those files which have been changed or added, saving you (and the server) lots of time.

If you just want to check what's changed in your local copy as opposed to the repository, do:

 git status

6.  Compiling the source

If you want to compile and run the development version, things are somewhat more complicated than for the downloaded tarballs, because you will need additional packages like automake, autoconf and gettext.

In Linux just follow the directions in INSTALL (this is pretty much like the usual ./autogen.sh, ./configure, make, and make install).

Alternatively consult INSTALL.Win32/MacOSX instructions.


7.  Changing the source

We strongly support any creative impulses you may have. Bug fixes, documentation, and new features will always be looked at carefully, and will usually be accepted, with a number of exceptions. New features will rarely be accepted for the stable release version.

If you'd like to make changes to LyX, it will make everyone's life easier if you change the latest Git sources rather than the latest release. Here's a quick rundown of what you would do:

  • Get the latest version of the source with git pull. A patch to old sources will be much harder to apply, and is therefore more likely to be ignored.
  • Change the files.
  • Run git diff > mypatch.diff to create a patch.
  • send the patch to the LyX developers' mailing list.

Even better, you can send a proper commit, ready to be applied to the developers' source tree:

  • Get the latest version of the source with git pull. A patch to old sources will be much harder to apply, and is therefore more likely to be ignored.
  • Change the files.
  • Run git commit -a to create a commit. Note that this will launch an editor where you can describe what your change does.
  • Run git format-patch -1, which creates a file 0001-title-of-your-patch.patch in the current directory.
  • send it to the LyX developers' mailing list.

8.  Write access via ssh

If you find yourself creating lots of patches that the LyX team incorporates into the code, you may be granted Git access. In that case, your life becomes even easier. More detailed info is in our wiki.

The non-wiki content of the LyX Home Page (e.g. the news and the announcements), upload section of wiki and dictionaries/thesauri are in standalone Git repositories.

9.  Git Branches

The main development in LyX is done in Git branches. If you are interested in helping with development or test work on these branches, you can check out a copy with a command like:

 git checkout 2.3.x

or

 git checkout master

on already cloned repository.

Branch NameRelease ManagerMaintainerStatusComment
master (trunk)R Heck unstableMaster Branch
branch 2.3.xS KostyshakRG HeckstableStable 2.3 series
branch 2.2.xS KostyshakRG HeckstableStable 2.2 series
branch 2.1.xVF RavesteijnRG HeckstableStable 2.1 series
branch 2.0.xP SandaRG HeckstableStable 2.0 series
branch 1.6.xJMatosJSpitzmstableStable 1.6 series
branch 1.5.xJMatosJSpitzmstableStable 1.5 series
branch 1.4.xLGBjønnesJMarcstableStable 1.4 series
branch 1.3.x JMarcstableStable 1.3 series
branch 1.2.xLGBjønnesJMarcstableStable 1.2 series
branch 1.1.6 JMarcstableStabilizing of 1.1.6