| 1 |
<!-- doc/src/sgml/sourcerepo.sgml --> |
| 2 |
|
| 3 |
<appendix id="sourcerepo"> |
| 4 |
<title>The Source Code Repository</title> |
| 5 |
|
| 6 |
<para> |
| 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. |
| 11 |
</para> |
| 12 |
|
| 13 |
<para> |
| 14 |
Our wiki, <ulink |
| 15 |
url="https://wiki.postgresql.org/wiki/Working_with_Git"></ulink>, |
| 16 |
has some discussion on working with Git. |
| 17 |
</para> |
| 18 |
|
| 19 |
<sect1 id="git"> |
| 20 |
<title>Getting the Source via <productname>Git</productname></title> |
| 21 |
|
| 22 |
<para> |
| 23 |
With <productname>Git</productname> you will make a copy of the entire code repository |
| 24 |
on your local machine, so you will have access to all history and branches |
| 25 |
offline. This is the fastest and most flexible way to develop or test |
| 26 |
patches. |
| 27 |
</para> |
| 28 |
|
| 29 |
<procedure> |
| 30 |
<title>Git</title> |
| 31 |
|
| 32 |
<step> |
| 33 |
<para> |
| 34 |
You will need an installed version of <productname>Git</productname>, which you can |
| 35 |
get from <ulink url="https://git-scm.com"></ulink>. Many systems already |
| 36 |
have a recent version of <application>Git</application> installed by default, or |
| 37 |
available in their package distribution system. |
| 38 |
</para> |
| 39 |
</step> |
| 40 |
|
| 41 |
<step> |
| 42 |
<para> |
| 43 |
To begin using the <productname>Git</productname> repository, make a clone of the official mirror: |
| 44 |
|
| 45 |
<programlisting> |
| 46 |
git clone https://git.postgresql.org/git/postgresql.git |
| 47 |
</programlisting> |
| 48 |
|
| 49 |
This will copy the full repository to your local machine, so it may take |
| 50 |
a while to complete, especially if you have a slow Internet connection. |
| 51 |
The files will be placed in a new subdirectory <filename>postgresql</filename> of |
| 52 |
your current directory. |
| 53 |
</para> |
| 54 |
</step> |
| 55 |
|
| 56 |
<step> |
| 57 |
<para> |
| 58 |
Whenever you want to get the latest updates in the system, <command>cd</command> |
| 59 |
into the repository, and run: |
| 60 |
|
| 61 |
<programlisting> |
| 62 |
git fetch |
| 63 |
</programlisting> |
| 64 |
</para> |
| 65 |
</step> |
| 66 |
</procedure> |
| 67 |
|
| 68 |
<para> |
| 69 |
<productname>Git</productname> can do a lot more things than just fetch the source. For |
| 70 |
more information, consult the <productname>Git</productname> man pages, or see the |
| 71 |
website at <ulink url="https://git-scm.com"></ulink>. |
| 72 |
</para> |
| 73 |
</sect1> |
| 74 |
|
| 75 |
</appendix> |