1
<!-- doc/src/sgml/sourcerepo.sgml -->
3
<appendix id="sourcerepo">
4
<title>The Source Code Repository</title>
7
The <productname>PostgreSQL</productname> source code is stored and managed
8
using the <productname>Git</productname> version control system. A public
9
mirror of the master repository is available; it is updated within a minute
10
of any change to the master repository.
15
url="http://wiki.postgresql.org/wiki/Working_with_Git"></ulink>,
16
has some discussion on working with Git.
20
Note that building <productname>PostgreSQL</productname> from the source
21
repository requires reasonably up-to-date versions of <application>bison</>,
22
<application>flex</>, and <application>Perl</>. These tools are not needed
23
to build from a distribution tarball since the files they are used to build
24
are included in the tarball. Other tool requirements are the same as shown
25
in <xref linkend="installation">.
29
<title>Getting The Source Via <productname>Git</></title>
32
With <productname>Git</> you will make a copy of the entire code repository
33
on your local machine, so you will have access to all history and branches
34
offline. This is the fastest and most flexible way to develop or test
43
You will need an installed version of <productname>Git</>, which you can
44
get from <ulink url="http://git-scm.com"></ulink>. Many systems already
45
have a recent version of <application>Git</> installed by default, or
46
available in their package distribution system.
52
To begin using the Git repository, make a clone of the official mirror:
55
git clone git://git.postgresql.org/git/postgresql.git
58
This will copy the full repository to your local machine, so it may take
59
a while to complete, especially if you have a slow Internet connection.
60
The files will be placed in a new subdirectory <filename>postgresql</> of
61
your current directory.
65
The Git mirror can also be reached via the HTTP protocol, if for example
66
a firewall is blocking access to the Git protocol. Just change the URL
67
prefix to <literal>http</>, as in:
70
git clone http://git.postgresql.org/git/postgresql.git
73
The HTTP protocol is less efficient than the Git protocol, so it will be
80
Whenever you want to get the latest updates in the system, <command>cd</>
81
into the repository, and run:
91
<productname>Git</> can do a lot more things than just fetch the source. For
92
more information, consult the <productname>Git</> man pages, or see the
93
website at <ulink url="http://git-scm.com"></>.