1 @c -*- coding: us-ascii; mode: texinfo; -*-
2 @node Starting with git
3 @chapter Starting with git
6 * Getting the source code::
7 * Updating the source code::
8 * Sharing your changes::
9 * Other interesting Git commands::
14 @node Getting the source code
15 @section Getting the source code
17 The source code is kept in a git respository.
19 @warning{These instructions assume that you are using the
20 command-line version of git 1.5 or higher.}
25 * Website source code::
26 * Documentation translations source code::
28 * Git user configuration::
31 @node Main source code
32 @subsection Main source code
34 To get the main source code and documentation,
39 mkdir lilypond; cd lilypond
41 git remote add -f -t master -m master origin git://git.sv.gnu.org/lilypond.git/
42 git checkout -b master origin/master
46 @node Website source code
47 @subsection Website source code
49 To get the website (including translations),
52 mkdir lilyweb ; cd lilyweb
54 git remote add -f -t web -m web origin git://git.sv.gnu.org/lilypond.git/
55 git checkout -b web origin/web
59 @node Documentation translations source code
60 @subsection Documentation translations source code
62 To translate the documentation (@emph{not} the website),
67 mkdir lilytranslate ; cd lilytranslate
69 git remote add -f -t web -m web origin git://git.sv.gnu.org/lilypond.git/
70 git checkout -b web origin/web
76 * Git user configuration::
80 @subsection Other branches
82 Most contributors will never need to touch the other branches. If
83 you wish to do so, you will need more familiarity with git.
88 This stores the Grand Unified Binary, our cross-platform building
92 FIXME: insert new gub addy
96 These branches are for individual developers. They store code
97 which is not yet stable enough to be added to the @code{master}
100 @item @code{stable/XYZ}:
101 The branches are kept for archival reasons.
106 @node Git user configuration
107 @subsection Git user configuration
109 To configure git to automatically use your name and email address
113 git config --global user.name "MYNAME"
114 git config --global user.email myemail@@example.net
118 @node Updating the source code
119 @section Updating the source code
122 * Importance of updating::
124 * Resolving conflicts::
128 @node Importance of updating
129 @subsection Importance of updating
131 In a large project like LilyPond, contributors sometimes edit the
132 same file at the same time. As long as everybody updates their
133 version of the file with the most recent changes (@qq{pull}ing),
134 there are generally no problems with this multiple-person editing.
135 However, serious problems can arise if you do not pull before
139 @subsection Updating command
141 Whenever you are asked to pull, it means you should update your
142 local copy of the repository with the changes made by others on
143 the remote @code{git.sv.gnu.org} repository:
149 @node Resolving conflicts
150 @subsection Resolving conflicts
152 Occasionally an update may result in conflicts -- this happens
153 when you and somebody else hae modified the same part of the same
154 file and git cannot figure out how to merge the two versions
155 together. When this happens, you must manually merge the two
163 @node Technical notes
164 @subsection Technical notes
166 Let's explain a bit of Git vocabulary. The @code{git pull
167 origin} command is just a shortcut for this command:
170 git pull git://git.sv.gnu.org/lilypond.git/ MY-BRANCH:origin/MY-BRANCH
173 A commit is a set of changes made to the sources; it also includes the
174 committish of the parent commit, the name and e-mail of the author
175 (the person who wrote the changes), the name and e-mail of the
176 committer (the person who brings these changes into the git
177 repository), and a commit message.
179 A committish is the SHA1 checksum of a commit, a number made of 40
180 hexadecimal digits, which acts as the internal unique identifier for
181 this commit. To refer to a particular revision, don't use vague
182 references like the (approximative) date, simply copy'n'paste the
185 A branch is a tree (in the mathematical or computer science sense) of
186 commits, and the topmost commit of this branch is called a head.
188 The "git fetch" command above has created a branch called origin/web
189 in your local Git repository. As this branch is a copy of the remote
190 branch web from git.sv.gnu.org LilyPond repository, it is
191 called a `remote branch', and is meant to track the changes on the
192 branch from git.sv.gnu.org: it will be updated every time you run 'git
193 pull' or 'git fetch' with this branch reference as argument, e.g.
194 by using .git/remotes/web remote file when running 'git fetch web'.
196 The 'git checkout' command above has created a branch named 'web'. At
197 the beginning, this branch is identical to 'origin/web', but it will
198 differ as soon as you make changes, e.g. adding newly translated
199 pages. Whenever you pull, you merge the changes from origin/web and
200 your web branch since the last pulling. If you do not have push
201 (i.e. "write") access on git.sv.gnu.org, your web branch will always
202 differ from origin/web. In this case, remember that other people
203 working like you on the remote web branch of
204 git://git.sv.gnu.org/lilypond.git/ know nothing about your own web
205 branch: this means that whenever you use a committish or make a patch,
206 others expect you to take the lastest commit of origin/web branch as a
209 This README tries to explain most of Git commands needed for
210 translating the web site. However, you are invited to read
211 further documentation to make git more familiar to you; for
212 instance, take a look at @uref{http://git.or.cz/gitwiki/},
213 especially GitDocumentation and GitGlossary; a good alternative to
214 reading the wiki is reading the first two chapters of Git User's
216 @uref{http://www.kernel.org/pub/software/scm/git/docs/user-manual.html}
221 @node Sharing your changes
222 @section Sharing your changes
226 * Producing a patch::
227 * Committing directly::
230 @node Producing a patch
231 @subsection Producing a patch
233 Once you have finished editing your files, checked that your
234 changes meet the @ref{Code style} and/or @ref{Documentation
235 policy}, and checked that the entire thing compiles, you may
239 git-format-patch HEAD
242 Send an email to @email{lilypond-devel@@gnu.org} with the diff as
246 @node Committing directly
247 @subsection Committing directly
249 Most contributors do not have permission to commit directly. If
250 you do, edit @file{.git/config} to contain
256 You may then @code{git push}.
259 @node Other interesting Git commands
260 @section Other interesting Git commands
262 The commands above don't only bring you the latest version of the
263 sources, but also the full history of revisions (revisons, also
264 called commits, are changes made to the sources), stored in the
265 .git directory. You can browse this history with
268 git log # only shows the logs (author, committish and commit message)
269 git log -p # also shows diffs
270 gitk # shows history graphically
277 @section Git on Windows