]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/contributor/working.itexi
Web-es: update CHANGES
[lilypond.git] / Documentation / contributor / working.itexi
1 @c -*- coding: utf-8; mode: texinfo; -*-
2
3
4 @node Working with source code
5 @chapter Working with source code
6
7
8 @menu
9 * Using lily-git::
10 * Starting with Git::
11 * Basic Git procedures::
12 * Advanced Git procedures::
13 * Git on Windows::
14 * Repository directory structure::
15 * Other Git documentation::
16 @end menu
17
18
19 @node Using lily-git
20 @section Using lily-git
21
22
23 FIXME: Add instructions for using @command{lily-git} here.
24
25
26 @node Starting with Git
27 @section Starting with Git
28
29
30 Using the Git program directly (as opposed to using the
31 @command{lily-git} GUI) allows you to have much greater control
32 over the contributing process.  You should consider using Git if
33 you want to work on complex projects, or if you want to work on
34 multiple projects concurrently.
35
36
37 @menu
38 * Setting up::
39 * Downloading remote branches::
40 @end menu
41
42
43 @node Setting up
44 @subsection Setting up
45
46
47 FIXME: Remove this note if incorporating Windows instructions
48 throughout this section:
49
50 @warning{These instructions assume that you are using the
51 command-line version of Git 1.5 or higher.  Windows users should
52 skip to @ref{Git on Windows}.}
53
54 @menu
55 * Installing Git::
56 * Initializing a repository::
57 * Configuring Git::
58 @end menu
59
60
61 @node Installing Git
62 @unnumberedsubsubsec Installing Git
63
64
65 If you are using a Unix-based machine, the easiest way to download
66 and install Git is through a package manager such as @command{rpm}
67 or @command{apt-get}---the installation is generally automatic.
68 The only required package is (usually) called @command{git-core},
69 although some of the auxiliary @command{git@var{*}} packages are
70 also useful (such as @command{gitk}).
71
72 Alternatively, you can visit the Git website
73 (@uref{http://git-scm.com/}) for downloadable binaries and
74 tarballs.
75
76 FIXME: add Windows installation instructions (or @@ref@{Git on
77 Windows@}).
78
79
80 @node Initializing a repository
81 @unnumberedsubsubsec Initializing a repository
82
83
84 Once Git is installed, you'll need to create a new directory where
85 your initial repository will be stored (the example below uses
86 @file{~/lilypond-git/}, where @code{~} represents your home
87 directory).  Run @command{git@tie{}init} from within the new
88 directory to initialize an empty repository:
89
90 @example
91 mkdir ~/lilypond-git/; cd ~/lilypond-git/
92 git init
93 @end example
94
95 @subsubheading Technical details
96
97 This creates (within the @file{~/lilypond-git/} directory) a
98 subdirectory called @file{.git/}, which Git uses to keep track of
99 changes to the repository, among other things.  Normally you don't
100 need to access it, but it's good to know it's there.
101
102
103 @node Configuring Git
104 @unnumberedsubsubsec Configuring Git
105
106 @warning{Throughout the rest of this manual, all command-line
107 input should be entered from the top directory of the Git
108 repository being discussed (eg. @file{~/lilypond-git/}).  This is
109 referred to as a @emph{top source directory}.}
110
111 Before downloading a copy of the main LilyPond repository, you
112 should configure some basic settings with the
113 @command{git@tie{}config} command.  Git allows you to set both
114 global and repository-specific options.
115
116 To configure settings that affect all repositories, use the
117 @command{--global} command line option.  For example, the first
118 two options that you should always set are your @var{name} and
119 @var{email}, since Git needs these to keep track of commit
120 authors:
121
122 @example
123 git config --global user.name "@var{John Smith}"
124 git config --global user.email @var{john@@example.com}
125 @end example
126
127 To configure Git to use colored output where possible, use:
128
129 @example
130 git config --global color.ui auto
131 @end example
132
133 The text editor that opens when using @command{git@tie{}commit}
134 can also be changed.  If none of your editor-related environment
135 variables are set ($GIT_EDITOR, $VISUAL, or $EDITOR), the default
136 editor is usually @command{vi} or @command{vim}.  If you're not
137 familiar with either of these, you should probably change the
138 default to an editor that you know how to use.  For example, to
139 change the default editor to @command{nano}, enter:
140
141 @example
142 git config --global core.editor @var{nano}
143 @end example
144
145 FIXME: Add instructions for changing the editor on Windows, which
146 is a little different, I think. -mp
147
148 @subsubheading Technical details
149
150 Git stores the information entered with
151 @command{git@tie{}config@tie{}--global} in the file
152 @file{.gitconfig}, located in your home directory.  This file can
153 also be modified directly, without using
154 @command{git@tie{}config}.  The @file{.gitconfig} file generated
155 by the above commands would look like this:
156
157 @example
158 [user]
159         name = John Smith
160         email = john@@example.com
161 [color]
162         ui = auto
163 [core]
164         editor = nano
165 @end example
166
167 Using the @command{git@tie{}config} command @emph{without} the
168 @command{--global} option configures repository-specific settings,
169 which are stored in the file @file{.git/config}.  This file is
170 created when a repository is initialized (using
171 @command{git@tie{}init}), and by default contains these lines:
172
173 @example
174 [core]
175         repositoryformatversion = 0
176         filemode = true
177         bare = false
178         logallrefupdates = true
179 @end example
180
181 However, since different repository-specific options are
182 recommended for different development tasks, it is best to avoid
183 setting any now.  Specific recommendations will be mentioned later
184 in this manual.
185
186
187 @node Downloading remote branches
188 @subsection Downloading remote branches
189
190
191 @menu
192 * Organization of remote branches::
193 * LilyPond repository sources::
194 * Downloading individual branches::
195 * Downloading all remote branches::
196 * Other branches::
197 @end menu
198
199
200 @node Organization of remote branches
201 @unnumberedsubsubsec Organization of remote branches
202
203
204 The main LilyPond repository is organized into @emph{branches} to
205 facilitate development.  These are often called @emph{remote}
206 branches to distinguish them from @emph{local} branches you might
207 create yourself (see @ref{Using local branches}).
208
209 The @code{master} branch contains all the source files used to
210 build LilyPond, which includes the program itself (both stable and
211 development releases), the documentation (and its translations),
212 and the website.  Generally, the @code{master} branch is expected
213 to compile successfully.
214
215 The @code{lilypond/translation} branch is a side branch that
216 allows translators to work without needing to worry about
217 compilation problems.  Periodically, the Translation Meister
218 (after verifying that it doesn't break compilation), will
219 @emph{merge} this branch back into @code{master} to incorporate
220 recent translations.  Similarly, the @code{master} branch is
221 usually merged into the @code{lilypond/translation} branch after
222 significant changes to the English documentation.  See
223 @ref{Translating the documentation} for details.
224
225
226 @node LilyPond repository sources
227 @unnumberedsubsubsec LilyPond repository sources
228
229
230 The recommended source for downloading a copy of the main
231 repository is:
232
233 @example
234 git://git.sv.gnu.org/lilypond.git
235 @end example
236
237 However, if your internet router filters out connections using the
238 GIT protocol, or if you experience difficulty connecting via GIT,
239 you can try these other sources:
240
241 @example
242 ssh://git.sv.gnu.org/srv/git/lilypond.git
243 http://git.sv.gnu.org/r/lilypond.git
244 @end example
245
246 The SSH protocol can only be used if your system is properly set
247 up to use it.  Also, the HTTP protocol is slowest, so it should
248 only be used as a last resort.
249
250
251 @node Downloading individual branches
252 @unnumberedsubsubsec Downloading individual branches
253
254
255 Once you have initialized an empty Git repository on your system
256 (see @ref{Initializing a repository}), you can download a remote
257 branch into it.  Make sure you know which branch you want to start
258 with.
259
260 To download the @code{master} branch, enter the following:
261
262 @example
263 git remote add -ft master -m master \
264   origin git://git.sv.gnu.org/lilypond.git/
265 @end example
266
267 To download the @code{lilypond/translation} branch, enter:
268
269 @example
270 git remote add -ft lilypond/translation -m \
271   lilypond/translation origin git://git.sv.gnu.org/lilypond.git/
272 @end example
273
274 The @command{git@tie{}remote@tie{}add} process could take up to
275 ten minutes, depending on the speed of your connection.  The
276 output will be something like this:
277
278 @example
279 Updating origin
280 remote: Counting objects: 235967, done.
281 remote: Compressing objects: 100% (42721/42721), done.
282 remote: Total 235967 (delta 195098), reused 233311 (delta 192772)
283 Receiving objects: 100% (235967/235967), 68.37 MiB | 479 KiB/s, done.
284 Resolving deltas: 100% (195098/195098), done.
285 From git://git.sv.gnu.org/lilypond
286  * [new branch]      master     -> origin/master
287 From git://git.sv.gnu.org/lilypond
288  * [new tag]         flower/1.0.1 -> flower/1.0.1
289  * [new tag]         flower/1.0.10 -> flower/1.0.10
290 â‹®
291  * [new tag]         release/2.9.6 -> release/2.9.6
292  * [new tag]         release/2.9.7 -> release/2.9.7
293 @end example
294
295 When @command{git@tie{}remote@tie{}add} is finished, the remote
296 branch should be downloaded into your repository---though not yet
297 in a form that you can use.  In order to browse the source code
298 files, you need to @emph{create} and @emph{checkout} your own
299 local branch.  In this case, however, it is easier to have Git
300 create the branch automatically by using the @command{checkout}
301 command on a non-existent branch.  Enter the following:
302
303 @example
304 git checkout -b @var{branch} origin/@var{branch}
305 @end example
306
307 @noindent
308 where @code{@var{branch}} is the name of your tracking branch,
309 either @code{master} or @code{lilypond/translation}.
310
311 Git will issue some warnings; this is normal:
312
313 @example
314 warning: You appear to be on a branch yet to be born.
315 warning: Forcing checkout of origin/master.
316 Branch master set up to track remote branch master from origin.
317 Already on 'master'
318 @end example
319
320 By now the source files should be accessible---you should be able
321 to edit any files in the @file{lilypond-git/} directory using a
322 text editor of your choice.  But don't start just yet!  Before
323 editing any source files, learn how to keep your changes organized
324 and prevent problems later---read @ref{Basic Git procedures}.
325
326 @subsubheading Technical Details
327
328 The @command{git@tie{}remote@tie{}add} command should add some
329 lines to your local repository's @file{.git/config} file:
330
331 @example
332 [remote "origin"]
333         url = git://git.sv.gnu.org/lilypond.git/
334         fetch = +refs/heads/master:refs/remotes/origin/master
335 @end example
336
337
338 @node Downloading all remote branches
339 @unnumberedsubsubsec Downloading all remote branches
340
341
342 To download all remote branches at once, you can @command{clone}
343 the entire repository:
344
345 @example
346 git clone git://git.sv.gnu.org/lilypond.git
347 @end example
348
349
350 @node Other branches
351 @unnumberedsubsubsec Other branches
352
353 Most contributors will never need to touch the other branches.  If
354 you wish to do so, you will need more familiarity with Git; please
355 see @ref{Other Git documentation}.
356
357 @itemize
358 @item @code{dev/XYZ}:
359 These branches are for individual developers.  They store code
360 which is not yet stable enough to be added to the @code{master}
361 branch.
362
363 @item @code{stable/XYZ}:
364 The branches are kept for archival reasons.
365
366 @end itemize
367
368 Another item of interest might be the Grand Unified Builder, our
369 cross-platform building tool.  Since it is used by projects as
370 well, it is not stored in our gub repository.  For more info, see
371 @uref{http://lilypond.org/gub}.  The git location is
372 @uref{http://github.com/janneke/gub}.
373
374
375 @node Basic Git procedures
376 @section Basic Git procedures
377
378
379 @menu
380 * The Git contributor's cycle::
381 * Pulling and rebasing::
382 * Using local branches::
383 * Commits and patches::
384 @end menu
385
386
387 @node The Git contributor's cycle
388 @subsection The Git contributor's cycle
389
390
391 Here is a simplified view of the contribution process on Git:
392
393 @enumerate
394 @item
395 Update your local repository by @emph{pulling} the most recent
396 updates from the remote repository.
397
398 @item
399 Edit source files within your local repository's @emph{working
400 directory}.
401
402 @item
403 @emph{Commit} the changes you've made to a local @emph{branch}.
404
405 @item
406 Generate a @emph{patch} to share your changes with the developers.
407 @end enumerate
408
409
410 @node Pulling and rebasing
411 @subsection Pulling and rebasing
412
413
414 When developers push new patches to the @code{git.sv.gnu.org}
415 repository, your local repository is @strong{not} automatically
416 updated.  It is important to keep your repository up-to-date by
417 periodically @emph{pulling} the most recent @emph{commits} from
418 the remote branch.  Developers expect patches to be as current as
419 possible, since outdated patches require extra work before they
420 can be used.
421
422 Occasionally you may need to rework some of your own modifications
423 to match changes made to the remote branch (see @ref{Resolving
424 conflicts}), and it's considerably easier to rework things
425 incrementally.  If you don't update your repository along the way,
426 you may have to spend a lot of time resolving branch conflicts and
427 reconfiguring much of the work you've already done.
428
429 Fortunately, Git is able to resolve certain types of branch
430 conflicts automatically with a process called @emph{rebasing}.
431 When rebasing, Git tries to modify your old commits so they appear
432 as new commits (based on the latest updates).  For a more involved
433 explanation, see the @command{git-rebase} man page.
434
435 To pull without rebasing (recommended for translators), use the
436 following command:
437
438 @example
439 git pull    # recommended for translators
440 @end example
441
442 If you're tracking the remote @code{master} branch, you should add
443 the @code{-r} option (short for @code{--rebase}) to keep commits
444 on your local branch current:
445
446 @example
447 git pull -r # use with caution when translating
448 @end example
449
450 If you don't edit translated documentation and don't want to type
451 @code{-r} every time, configure the master branch to rebase by
452 default with this command:
453
454 @example
455 git config branch.master.rebase true
456 @end example
457
458 FIXME: I think the next paragraph is confusing.  Perhaps prepare
459 the reader for new terms `committish' and `head'?  -mp
460
461 @warning{translators and documentation editors, if you have
462 changed committishes in the head of translated files using commits
463 you have not yet pushed to @code{git.sv.gnu.org}, please do not
464 rebase.  If you want to avoid wondering whether you should rebase
465 each time you pull, please always use committishes from master
466 and/or lilypond/translation branch on @code{git.sv.gnu.org}, which
467 in particular implies that you must push your changes to
468 documentation except committishes updates (possibly after having
469 rebased), then update the committishes and push them.}
470
471 FIXME: when committishes automatic conditional update have been
472 tested and documented, append the following to the warning above:
473 Note that using update-committishes make target generally touches
474 committishes.
475
476 @subsubheading Technical details
477
478 The @command{git@tie{}config} command mentioned above adds the
479 line @code{rebase = true} to the master branch in your local
480 repository's @file{.git/config} file:
481
482 @example
483 [branch "master"]
484         remote = origin
485         merge = refs/heads/master
486         rebase = true
487 @end example
488
489
490 @node Using local branches
491 @subsection Using local branches
492
493
494 @menu
495 * Creating and removing branches::
496 * Listing branches and remotes::
497 * Checking out branches::
498 * Merging branches::
499 @end menu
500
501
502 @node Creating and removing branches
503 @unnumberedsubsubsec Creating and removing branches
504
505
506 Local branches are useful when you're working on several different
507 projects concurrently.  To create a new branch, enter:
508
509 @example
510 git branch @var{name}
511 @end example
512
513 To delete a branch, enter:
514
515 @example
516 git branch -d @var{name}
517 @end example
518
519 Git will ask you for confirmation if it sees that data would be
520 lost by deleting the branch.  Use @code{-D} instead of @code{-d}
521 to bypass this.  Note that you cannot delete a branch if it is
522 currently checked out.
523
524
525 @node Listing branches and remotes
526 @unnumberedsubsubsec Listing branches and remotes
527
528 You can get the exact path or URL of all remote branches by
529 running:
530
531 @example
532 git remote -v
533 @end example
534
535 To list Git branches on your local repositories, run
536
537 @example
538 git branch     # list local branches only
539 git branch -r  # list remote branches
540 git branch -a  # list all branches
541 @end example
542
543
544 @node Checking out branches
545 @unnumberedsubsubsec Checking out branches
546
547 To know the currently checked out branch, i.e. the branch whose
548 source files are present in your working tree, read the first line
549 of the output of
550
551 @example
552 git status
553 @end example
554
555 @noindent
556 The currently checked out branch is also marked with an asterisk
557 in the output of @command{git branch}.
558
559 You can check out another branch @code{@var{other_branch}}, i.e.
560 check out @code{@var{other_branch}} to the working tree, by
561 running
562
563 @example
564 git checkout @var{other_branch}
565 @end example
566
567 Note that it is possible to check out another branch while having
568 uncommitted changes, but it is not recommended unless you know
569 what you are doing; it is recommended to run @command{git status}
570 to check this kind of issue before checking out another branch.
571
572 @node Merging branches
573 @unnumberedsubsubsec Merging branches
574
575 To merge branch @code{@var{foo}} into branch @code{@var{bar}},
576 i.e. to @qq{add} all changes made in branch @code{@var{foo}} to
577 branch @code{@var{bar}}, run
578
579 @example
580 git checkout @var{bar}
581 git merge @var{foo}
582 @end example
583
584 If any conflict happens, see @ref{Resolving conflicts}.
585
586 There are common usage cases for merging: as a translator, you
587 will often want to merge @code{master} into
588 @code{lilypond/translation}; on the other hand, the Translations
589 meister wants to merge @code{lilypond/translation} into
590 @code{master} whenever he has checked that
591 @code{lilypond/translation} builds successfully.
592
593
594 @node Commits and patches
595 @subsection Commits and patches
596
597
598 @menu
599 * Understanding commits::
600 * Making commits::
601 * Commit messages::
602 * Making patches::
603 @end menu
604
605
606 @node Understanding commits
607 @unnumberedsubsubsec Understanding commits
608
609 Technically, a @emph{commit} is a single point in the history of a
610 branch, but most developers use the term to mean a @emph{commit
611 object}, which stores information about a particular revision.  A
612 single commit can record changes to multiple source files, and
613 typically represents one logical set of related changes (such as a
614 bug-fix).  You can list the ten most recent commits in your
615 current branch with this command:
616
617 @example
618 git log -10 --oneline
619 @end example
620
621 If you're using an older version of Git and get an @q{unrecognized
622 argument} error, use this instead:
623
624 @example
625 git log -10 --pretty=oneline --abbrev-commit
626 @end example
627
628 More interactive lists of the commits on the remote @code{master}
629 branch are available at
630 @uref{http://git.sv.gnu.org/gitweb/?p=lilypond.git;a=shortlog} and
631 @uref{http://git.sv.gnu.org/cgit/lilypond.git/log/}.
632
633
634 @node Making commits
635 @unnumberedsubsubsec Making commits
636
637
638 Once you have modified some source files in your working
639 directory, you can make a commit with the following procedure:
640
641 @enumerate
642 @item
643 Make sure you've configured Git properly (see @ref{Configuring
644 Git}).  Check that your changes meet the requirements described in
645 @ref{Code style} and/or @ref{Documentation policy}.  For advanced
646 edits, you may also want to verify that the changes don't break
647 the compilation process.
648
649 @item
650 Run the following command:
651
652 @example
653 git status
654 @end example
655
656 @noindent
657 to make sure you're on the right branch, and to see which files
658 have been modified, added or removed, etc.  You may need to tell
659 Git about any files you've added by running one of these:
660
661 @example
662 git add @var{file}  # add untracked @var{file} individually
663 git add .     # add all untracked files in current directory
664 @end example
665
666 @noindent
667 After @command{git@tie{}add}, run @command{git@tie{}status} again
668 to make sure you got everything.  You may also need to modify
669 @file{GNUmakefile}.
670
671 @item
672 Preview the changes about to be committed (to make sure everything
673 looks right) with:
674
675 @example
676 git diff HEAD
677 @end example
678
679 @noindent
680 The @code{HEAD} argument refers to the most recent commit on the
681 currently checked-out branch.
682
683 @item
684 Generate the commit with:
685
686 @example
687 git commit -a
688 @end example
689
690 @noindent
691 The @code{-a} is short for @code{--all} which includes modified
692 and deleted files, but only those newly created files that have
693 previously been added.
694
695 @end enumerate
696
697
698 @node Commit messages
699 @unnumberedsubsubsec Commit messages
700
701
702 When you run the @command{git@tie{}commit@tie{}-a} command, Git
703 automatically opens the default text editor so you can enter a
704 @emph{commit message}.  If you find yourself in a foreign editing
705 environment, you're probably in @command{vi} or @command{vim}.  If
706 you want to switch to an editor you're more familiar with, quit by
707 typing @code{:q!} and pressing @code{<Enter>}.  See
708 @ref{Configuring Git} for instructions on changing the default
709 editor.
710
711 In any case, Git will open a text file for your commit message
712 that looks like this:
713
714 @example
715
716 # Please enter the commit message for your changes. Lines starting
717 # with '#' will be ignored, and an empty message aborts the commit.
718 # On branch master
719 # Changes to be committed:
720 #   (use "git reset HEAD <file>..." to unstage)
721 #
722 #       modified:   working.itexi
723 #
724 @end example
725
726 Your commit message should begin with a one-line summary
727 describing the change (no more than 50 characters long), and if
728 necessary a blank line followed by several lines giving the
729 details:
730
731 @c $ git log -1 --pretty=medium 4d6f1e5
732 @example
733 Doc: add Baerenreiter and Henle solo cello suites
734
735 Added comparison of solo cello suite engravings to new essay with
736 high-res images, fixed cropping on Finale example.
737 @end example
738
739 Commit messages often start with a short prefix describing the
740 general location of the changes.  If a commit affects the
741 documentation in English (or in several languages simultaneously)
742 the commit message should be prefixed with @qq{Doc:@tie{}}.  If
743 the commit affects only one of the translations, the commit
744 message should be prefixed with @qq{Doc-@var{**}:@tie{}}, where
745 @var{**} is the two-letter language code.  Commits that affect the
746 website should use @qq{Web:@tie{}} for English, and
747 @qq{Web-@var{**}:@tie{}} for the other languages.  Also, changes
748 to a single file are often prefixed with the name of the file
749 involved.  Visit the links listed in @ref{Understanding commits}
750 for examples.
751
752
753 @node Making patches
754 @unnumberedsubsubsec Making patches
755
756
757 If you want to share your changes with other contributors and
758 developers, you need to generate @emph{patches} from your commits.
759 You should always run @command{git@tie{}pull@tie{}-r} (translators
760 should leave off the @code{-r}) before doing this to ensure that
761 your patches are as current as possible.
762
763 Once you have made one or more commits in your local repository,
764 and pulled the most recent commits from the remote branch, you can
765 generate patches from your local commits with the command:
766
767 @example
768 git format-patch origin
769 @end example
770
771 The @code{origin} argument refers to the remote tracking branch at
772 @code{git.sv.gnu.org}.  This command generates a separate patch
773 for each commit that's in the current branch but not in the remote
774 branch.  Patches are placed in the current working directory and
775 will have names that look something like this:
776
777 @example
778 0001-Doc-Fix-typos.patch
779 0002-Web-Remove-dead-links.patch
780 â‹®
781 @end example
782
783 Send an email to @email{lilypond-devel@@gnu.org} briefly
784 explaining your work, with the patch files attached.  Translators
785 should send patches to @email{translations@@lilynet.net}.  After
786 your patches are reviewed, the developers may push one or more of
787 them to the main repository or discuss them with you.
788
789 @seealso
790
791 If your patch includes a significant amount of code, you may want
792 to see @ref{Adding or modifying features}, especially @emph{Post
793 patch for comments}.
794
795
796 @node Advanced Git procedures
797 @section Advanced Git procedures
798
799
800 @warning{This section is not necessary for normal contributors;
801 these commands are presented for information for people interested
802 in learning more about git.}
803
804 It is possible to work with several branches on the same local Git
805 repository; this is especially useful for translators who may have
806 to deal with both @code{lilypond/translation} and a stable branch,
807 e.g. @code{stable/2.12}.
808
809 Some Git commands are introduced first, then a workflow with
810 several Git branches of LilyPond source code is presented.
811
812
813 @menu
814 * Advanced Git concepts::
815 * Resolving conflicts::
816 * Reverting all local changes::
817 * Working with remote branches::
818 * Git log::
819 * Applying remote patches::
820 * Sending and receiving patches via email::
821 * Commit access::
822 @end menu
823
824
825 @node Advanced Git concepts
826 @subsection Advanced Git concepts
827
828
829 A bit of Git vocabulary will be explained below.  The following is
830 only introductory; for a better understanding of Git concepts, you
831 may wish to read @ref{Other Git documentation}.
832
833 The @code{git@tie{}pull@tie{}origin} command above is just a
834 shortcut for this command:
835
836 @example
837 git pull git://git.sv.gnu.org/lilypond.git/ @var{branch}:origin/@var{branch}
838 @end example
839
840 @noindent
841 where @code{@var{branch}} is typically @code{master} or
842 @code{lilypond/translation}; if you do not know or remember, see
843 @ref{Downloading remote branches} to remember which commands you
844 issued or which source code you wanted to get.
845
846 A @emph{commit} is a set of changes made to the sources; it also
847 includes the committish of the parent commit, the name and e-mail
848 of the @emph{author} (the person who wrote the changes), the name
849 and e-mail of the @emph{committer} (the person who brings these
850 changes into the Git repository), and a commit message.
851
852 A @emph{committish} is the SHA1 checksum of a commit, a number
853 made of 40 hexadecimal digits, which acts as the internal unique
854 identifier for this commit.  To refer to a particular revision,
855 don't use vague references like the (approximative) date, simply
856 copy and paste the committish.
857
858 A @emph{branch} is nothing more than a pointer to a particular
859 commit, which is called the @emph{head} of the branch; when
860 referring to a branch, one often acutally thinks about its head
861 and the ancestor commits of the head.
862
863 Now we will explain the two last commands you used to get the
864 source code from Git---see @ref{Downloading individual branches}.
865
866 @example
867 git remote add -ft @var{branch} -m @var{branch} \
868   origin git://git.sv.gnu.org/lilypond.git/
869
870 git checkout -b @var{branch} origin/@var{branch}
871 @end example
872
873 The @command{git@tie{}remote} has created a branch called
874 @code{origin/@var{branch}} in your local Git repository.  As this
875 branch is a copy of the remote branch web from git.sv.gnu.org
876 LilyPond repository, it is called a @emph{remote branch}, and is
877 meant to track the changes on the branch from git.sv.gnu.org: it
878 will be updated every time you run
879 @command{git@tie{}pull@tie{}origin} or
880 @command{git@tie{}fetch@tie{}origin}.
881
882 The @command{git@tie{}checkout} command has created a branch named
883 @code{@var{branch}}.  At the beginning, this branch is identical
884 to @code{origin/@var{branch}}, but it will differ as soon as you
885 make changes, e.g. adding newly translated pages or editing some
886 documentation or code source file.  Whenever you pull, you merge
887 the changes from @code{origin/@var{branch}} and
888 @code{@var{branch}} since the last pulling.  If you do not have
889 push (i.e. @qq{write}) access on git.sv.gnu.org, your
890 @code{@var{branch}} will always differ from
891 @code{origin/@var{branch}}.  In this case, remember that other
892 people working like you with the remote branch @code{@var{branch}}
893 of git://git.sv.gnu.org/lilypond.git/ (called
894 @code{origin/@var{branch}} on your local repository) know nothing
895 about your own @code{@var{branch}}: this means that whenever you
896 use a committish or make a patch, others expect you to take the
897 latest commit of @code{origin/@var{branch}} as a reference.
898
899 Finally, please remember to read the man page of every Git command
900 you will find in this manual in case you want to discover
901 alternate methods or just understand how it works.
902
903
904 @node Resolving conflicts
905 @subsection Resolving conflicts
906
907
908 Occasionally an update may result in conflicts -- this happens
909 when you and somebody else have modified the same part of the same
910 file and git cannot figure out how to merge the two versions
911 together.  When this happens, you must manually merge the two
912 versions.
913
914 If you need some documentation to understand and resolve
915 conflicts, see paragraphs @emph{How conflicts are presented} and
916 @emph{How to resolve conflicts} in @command{git merge} man page.
917
918 If all else fails, you can follow the instructions in
919 @ref{Reverting all local changes}.  Be aware that this eliminates
920 any changes you have made!
921
922
923 @node Reverting all local changes
924 @subsection Reverting all local changes
925
926 Sometimes git will become hopelessly confused, and you just want
927 to get back to a known, stable state.  This command destroys any
928 local changes you have made, but at least you get back to the
929 current online version:
930
931 @example
932 git reset --hard origin/master
933 @end example
934
935
936 @node Working with remote branches
937 @subsection Working with remote branches
938
939
940 @subsubheading Fetching new branches from git.sv.gnu.org
941
942 To fetch and check out a new branch named @code{@var{branch}} on
943 git.sv.gnu.org, run from top of the Git repository
944
945 @example
946 git config --add remote.origin.fetch \
947   +refs/heads/@var{branch}:refs/remotes/origin/@var{branch}
948
949 git checkout --track -b @var{branch} origin/@var{branch}
950 @end example
951
952 After this, you can pull @code{@var{branch}} from git.sv.gnu.org
953 with:
954
955 @example
956 git pull
957 @end example
958
959 Note that this command generally fetches all branches you added
960 with @command{git@tie{}remote@tie{}add} (when you initialized the
961 repository) or @command{git@tie{}config@tie{}--add}, i.e. it
962 updates all remote branches from remote @code{origin}, then it
963 merges the remote branch tracked by the current branch into the
964 current branch.  For example, if your current branch is
965 @code{master}, @code{origin/master} will be merged into
966 @code{master}.
967
968
969 @subsubheading Local clones, or having several working trees
970
971 If you play with several Git branches, e.g. @code{master},
972 @code{lilypond/translation}, @code{stable/2.12}), you may want to
973 have one source and build tree for each branch; this is possible
974 with subdirectories of your local Git repository, used as local
975 cloned subrepositories.  To create a local clone for the branch
976 named @code{@var{branch}}, run
977
978 @example
979 git checkout @var{branch}
980 git clone -lsn . @var{subdir}
981 cd @var{subdir}
982 git reset --hard
983 @end example
984
985 Note that @code{@var{subdir}} must be a directory name which does
986 not already exist.  In @code{@var{subdir}}, you can use all Git
987 commands to browse revisions history, commit and uncommit changes;
988 to update the cloned subrepository with changes made on the main
989 repository, cd into @code{@var{subdir}} and run
990 @command{git@tie{}pull}; to send changes made on the subrepository
991 back to the main repository, run @command{git@tie{}push} from
992 @code{@var{subdir}}.  Note that only one branch (the currently
993 checked out branch) is created in the subrepository by default; it
994 is possible to have several branches in a subrepository and do
995 usual operations (checkout, merge, create, delete...) on these
996 branches, but this possibility is not detailed here.
997
998 When you push @code{@var{branch}} from @code{@var{subdir}} to the
999 main repository, and @code{@var{branch}} is checked out in the
1000 main repository, you must save uncommitted changes (see
1001 @command{git@tie{}stash}) and do
1002 @command{git@tie{}reset@tie{}--hard} in the main repository in
1003 order to apply pushed changes in the working tree of the main
1004 repository.
1005
1006
1007 @node Git log
1008 @subsection Git log
1009
1010
1011 The commands above don't only bring you the latest version of the
1012 sources, but also the full history of revisions (revisons, also
1013 called commits, are changes made to the sources), stored in the
1014 @file{.git} directory.  You can browse this history with
1015
1016 @example
1017 git log     # only shows the logs (author, committish and commit message)
1018 git log -p  # also shows diffs
1019 gitk        # shows history graphically
1020 @end example
1021
1022 @warning{The @code{gitk} command may require a separate
1023 @code{gitk} package, available in the appropriate distribution's
1024 repositories.}
1025
1026
1027 @node Applying remote patches
1028 @subsection Applying remote patches
1029
1030
1031 FIXME: Explain how to determine if a patch was created with
1032 @code{git@tie{}format-patch}.
1033
1034 Well-formed git patches created with @code{git@tie{}format-patch}
1035 should be committed with the following command:
1036
1037 @example
1038 git am @var{patch}
1039 @end example
1040
1041 Patches created without @code{git@tie{}format-patch} can be
1042 applied in two steps.  The first step is to apply the patch to the
1043 working tree:
1044
1045 @example
1046 git apply @var{patch}
1047 @end example
1048
1049 @noindent
1050 The second step is to commit the changes and give credit to the
1051 author of the patch.  This can be done with the following command:
1052
1053 @example
1054 git commit -a --author="@var{John Smith} <@var{john@@example.com}>"
1055 @end example
1056
1057
1058 @node Sending and receiving patches via email
1059 @subsection Sending and receiving patches via email
1060
1061
1062 The default @code{x-diff} MIME type associated with patch files
1063 (i.e., files whose name ends in @code{.patch}) means that the
1064 encoding of line endings may be changed from UNIX to DOS format
1065 when they are sent as attachments.  Attempting to apply such an
1066 inadvertently altered patch will cause git to fail with a message
1067 about @q{whitespace errors}.
1068
1069 The solution to such problems is surprisingly simple---just change
1070 the default file extension of patches generated by git to end in
1071 @code{.txt}, for example:
1072
1073 @example
1074 git config format.suffix '.patch.txt'
1075 @end example
1076
1077 This should cause email programs to apply the correct base64
1078 encoding to attached patches.
1079
1080 If you receive a patch with DOS instead of UNIX line-endings, it
1081 can be converted back using the @code{dos2unix} utility.
1082
1083 Lots of useful information on email complications with patches is
1084 provided on the Wine wiki at
1085 @uref{http://wiki.winehq.org/GitWine}.
1086
1087
1088 @node Commit access
1089 @subsection Commit access
1090
1091
1092 Most contributors are not able to commit patches directly to the
1093 main repository---only members of the LilyPond development team
1094 have @emph{commit access}.  If you are a contributor and are
1095 interested in joining the development team, contact the Project
1096 Manager through the mailing list
1097 (@email{lilypond-devel@@gnu.org}).  Generally, only contributors
1098 who have already provided a number of patches which have been
1099 pushed to the main repository will be considered for membership.
1100
1101 If you have been approved by the Project Manager, use the
1102 following procedure to obtain commit access:
1103
1104 @enumerate
1105 @item
1106 If you don't already have one, set up a Savannah user account at
1107 @uref{https://savannah.gnu.org/account/register.php}.  If your web
1108 browser responds with an @qq{untrusted connection} message when
1109 you visit the link, follow the steps for including the CAcert root
1110 certificate in your browser, given at
1111 @uref{http://savannah.gnu.org/tls/tutorial/}.
1112
1113 @item
1114 After registering, if you are not logged in automatically, login
1115 at @uref{https://savannah.gnu.org/account/login.php}---this should
1116 take you to your @qq{my} page
1117 (@uref{https://savannah.gnu.org/my/}).
1118
1119 @item
1120 Click on the @qq{My Groups} link to access the @qq{My Group
1121 Membership} page.  From there, find the @qq{Request for Inclusion}
1122 box and search for @qq{LilyPond}.  Among the search results, check
1123 the box labeled @qq{GNU LilyPond Music Typesetter} and write a
1124 brief (required) message for the Project Manager (@qq{Hey it's
1125 me!} should be fine).
1126
1127 Note that you will not have commit access until the Project
1128 Manager activates your membership.  Once your membership is
1129 activated, LilyPond should appear under the heading @qq{Groups I'm
1130 Contributor of} on your @qq{My Group Membership} page.
1131
1132 @item
1133 Go to the @qq{My Account Configuration} page.  From there, click
1134 on @qq{Edit SSH Keys} and follow the instructions given.
1135
1136 FIXME: Explain the confusing warning I always get. -mp
1137
1138 FIXME: Maybe add a note about enabling/disabling SSH passphrase?
1139
1140 @item
1141 Configure Git to use the SSH protocol (instead of the GIT
1142 protocol).  From your local Git repository, enter:
1143
1144 @example
1145 git config remote.origin.url \
1146   ssh://@var{user}@@git.sv.gnu.org/srv/git/lilypond.git
1147 @end example
1148
1149 @noindent
1150 where @var{user} is your username on Savannah.
1151
1152 @item
1153 After your membership has been activated and you've configured Git
1154 to use SSH, try doing a @command{git@tie{}pull} or
1155 @command{git@tie{}pull@tie{}-r}.  If that succeeds, this indicates
1156 that your SSH key stored at Savannah is working properly.
1157
1158 FIXME: show what success/failure look like.
1159
1160 @item
1161 Test your commit access with a dry run:
1162
1163 @example
1164 git push --dry-run --verbose
1165 @end example
1166
1167 Note that recent versions of Git (Git 1.6.3 or later) will issue a
1168 big warning if the above command is used.  The simplest solution
1169 is to tell Git to push all matching branches by default:
1170
1171 @example
1172 git config push.default matching
1173 @end example
1174
1175 @noindent
1176 Then @code{git@tie{}push} should work as before.  For more
1177 details, consult the @code{git@tie{}push} man page.
1178 @end enumerate
1179
1180
1181 @subsubheading Technical details
1182
1183 @itemize
1184 @item
1185 On Firefox, to view or remove the CAcert root certificate, go to:
1186 Edit > Preferences > Advanced > Encryption > View Certificates >
1187 Authorities > Certificate Name > Root CA > CA Cert Signing
1188 Authority.
1189
1190 @item
1191 The @command{git@tie{}config} commands above should modify your
1192 local repository's @file{.git/config} file.  These lines:
1193
1194 @example
1195 [remote "origin"]
1196         url = git://git.sv.gnu.org/lilypond.git/
1197 @end example
1198
1199 @noindent
1200 should now be changed to:
1201
1202 @example
1203 [remote "origin"]
1204         url = ssh://@var{user}@@git.sv.gnu.org/srv/git/lilypond.git
1205 @end example
1206
1207 @noindent
1208 where @var{user} is your login name on Savannah.
1209
1210 @item
1211 Similarly, the
1212 @command{git@tie{}config@tie{}push.default@tie{}matching} command
1213 should add these lines to @file{.git/config}:
1214
1215 @example
1216 [push]
1217         default = matching
1218 @end example
1219 @end itemize
1220
1221 @node Git on Windows
1222 @section Git on Windows
1223
1224 @c Some of this may duplicate stuff in other sections
1225 @c But it is probably best for windows users to have it all together
1226 @c If necessary, clear this up later  -td
1227
1228 FIXME: Decide what to do with this...  Pare it down?  Move
1229 paragraphs next to analogous Unix instructions? -mp
1230
1231 @subsection Background to nomenclature
1232
1233 Git is a system for tracking the changes made to source files by a
1234 distributed set of editors.  It is designed to work without a
1235 master repository, but we have chosen to have a master respository
1236 for LilyPond files.  Editors hold a local copy of the master
1237 repository together with any changes they have made locally.
1238 Local changes are held in a local @q{branch}, of which there may
1239 be several, but these instructions assume you are using just one.
1240 The files visible in the local repository always correspond to
1241 those on the currently @q{checked out} local branch.
1242
1243 Files are edited on a local branch, and in that state the changes
1244 are said to be @q{unstaged}.  When editing is complete, the
1245 changes are moved to being @q{staged for commit}, and finally the
1246 changes are @q{committed} to the local branch.  Once committed,
1247 the changes (called a @q{commit}) are given a unique 40-digit
1248 hexadecimal reference number called the @q{Committish} or @q{SHA1
1249 ID} which identifies the commit to Git.  Such committed changes
1250 can be sent to the master repository by @q{pushing} them (if you
1251 have write permission) or by sending them by email to someone who
1252 has, either as a complete file or as a @q{diff} or @q{patch}
1253 (which send just the differences from the master repository).
1254
1255 @subsection Installing git
1256
1257 Obtain Git from
1258 @uref{http://code.google.com/p/msysgit/downloads/list} (note, not
1259 msysGit, which is for Git developers and not PortableGit, which is
1260 not a full git installation) and install it.
1261
1262 Note that most users will not need to install SSH.  That is not
1263 required until you have been granted direct push permissions to
1264 the master git repository.
1265
1266 Start Git by clicking on the desktop icon.  This will bring up a
1267 command line bash shell.  This may be unfamiliar to Windows users.
1268 If so, follow these instructions carefully.  Commands are entered
1269 at a $ prompt and are terminated by keying a newline.
1270
1271 @subsection Initialising Git
1272
1273 Decide where you wish to place your local Git repository, creating
1274 the folders in Windows as necessary.  Here we call the folder to
1275 contain the repository @code{[path]/Git}, but if you intend using
1276 Git for other projects a directory name like @code{lilypond-git}
1277 might be better.  You will need to have space for around
1278 100Mbytes.
1279
1280 Start the Git bash shell by clicking on the desk-top icon
1281 installed with Git and type
1282
1283 @example
1284 cd [path]/Git
1285 @end example
1286
1287 to position the shell at your new Git repository.
1288
1289 Note: if [path] contains folders with names containing spaces use
1290
1291 @example
1292 cd "[path]/Git"
1293 @end example
1294
1295 Then type
1296
1297 @example
1298 git init
1299 @end example
1300
1301 to initialize your Git repository.
1302
1303 Then type (all on one line; the shell will wrap automatically)
1304
1305 @example
1306 git remote add -ft master origin git://git.sv.gnu.org/lilypond.git
1307 @end example
1308
1309 to download the lilypond master files.
1310
1311 @warning{Be patient!  Even on a broadband connection this can take
1312 10 minutes or more.  Wait for lots of [new tag] messages and the $
1313 prompt.}
1314
1315 We now need to generate a local copy of the downloaded files in a
1316 new local branch.  Your local branch needs to have a name.  It is
1317 usual to call it @q{master} and we shall do that here.
1318
1319 To do this, type
1320
1321 @example
1322 git checkout -b master origin/master
1323 @end example
1324
1325 This creates a second branch called @q{master}.  You will see two
1326 warnings (ignore these), and a message advising you that your
1327 local branch @q{master} has been set up to track the remote
1328 branch.  You now have two branches, a local branch called
1329 @q{master}, and a tracking branch called @q{origin/master}, which
1330 is a shortened form of @q{remotes/origin/master}.
1331
1332 Return to Windows Explorer and look in your Git repository.  You
1333 should see lots of folders.  For example, the LilyPond
1334 documentation can be found in [path]/Git/Documentation/.
1335
1336 The Git bash shell is terminated by typing @code{exit} or by
1337 clicking on the usual Windows close-window widget.
1338
1339 @subsection Git GUI
1340
1341 Almost all subsequent work will use the Git Graphical User
1342 Interface, which avoids having to type command line commands. To
1343 start Git GUI first start the Git bash shell by clicking on the
1344 desktop icon, and type
1345
1346 @example
1347 cd [path]/Git
1348 git gui
1349 @end example
1350
1351 The Git GUI will open in a new window.  It contains four panels
1352 and 7 pull-down menus.  At this stage do not use any of the
1353 commands under Branch, Commit, Merge or Remote.  These will be
1354 explained later.
1355
1356 The top panel on the left contains the names of files which you
1357 are in the process of editing (Unstaged Changes), and the lower
1358 panel on the left contains the names of files you have finished
1359 editing and have staged ready for committing (Staged Changes).  At
1360 present, these panels will be empty as you have not yet made any
1361 changes to any file.  After a file has been edited and saved the
1362 top panel on the right will display the differences between the
1363 edited file selected in one of the panels on the left and the last
1364 version committed on the current branch.
1365
1366 The panel at bottom right is used to enter a descriptive message
1367 about the change before committing it.
1368
1369 The Git GUI is terminated by entering CNTL-Q while it is the
1370 active window or by clicking on the usual Windows close-window
1371 widget.
1372
1373 @subsection Personalising your local git repository
1374
1375 Open the Git GUI, click on
1376
1377 @example
1378 Edit -> Options
1379 @end example
1380
1381 and enter your name and email address in the left-hand (Git
1382 Repository) panel.  Leave everything else unchanged and save it.
1383
1384 Note that Windows users must leave the default setting for line
1385 endings unchanged.  All files in a git repository must have lines
1386 terminated by just a LF, as this is required for Merge to work,
1387 but Windows files are terminated by CRLF by default.  The git
1388 default setting causes the line endings of files in a Windows git
1389 repository to be flipped automatically between LF and CRLF as
1390 required.  This enables files to be edited by any Windows editor
1391 without causing problems in the git repository.
1392
1393 @subsection Checking out a branch
1394
1395 At this stage you have two branches in your local repository,
1396 both identical.  To see them click on
1397
1398 @example
1399 Branch -> Checkout
1400 @end example
1401
1402 You should have one local branch called @q{master} and one
1403 tracking branch called @q{origin/master}.  The latter is your
1404 local copy of the @q{remotes/origin/master} branch in the master
1405 LilyPond repository.  The local @q{master} branch is where you
1406 will make your local changes.
1407
1408 When a particular branch is selected, i.e., checked out, the files
1409 visible in your repository are changed to reflect the state of the
1410 files on that branch.
1411
1412 @subsection Updating files from @q{remote/origin/master}
1413
1414 Before starting the editing of a file, ensure your local
1415 repository contains the latest version of the files in the remote
1416 repository by first clicking
1417
1418 @example
1419 Remote -> Fetch from -> origin
1420 @end example
1421
1422 @noindent
1423 in the Git GUI.
1424
1425 This will place the latest version of every file, including all
1426 the changes made by others, into the @q{origin/master} branch of
1427 the tracking branches in your git repository.  You can see these
1428 files by checking out this branch, but you must @emph{never} edit
1429 any files while this branch is checked out.  Check out your local
1430 @q{master} branch again.
1431
1432 You then need to merge these fetched files into your local
1433 @q{master} branch by clicking on
1434
1435 @example
1436 Merge -> Local Merge
1437 @end example
1438
1439 @noindent
1440 and if necessary select the local @q{master} branch.
1441
1442 Note that a merge cannot be completed if you have made any local
1443 changes which have not yet been committed.
1444
1445 This merge will update all the files in the @q{master} branch to
1446 reflect the current state of the @q{origin/master} branch.  If any
1447 of the changes conflict with changes you have made yourself
1448 recently you will be notified of the conflict (see below).
1449
1450 @subsection Editing files
1451
1452 First ensure your @q{master} branch is checked out, then simply
1453 edit the files in your local Git repository with your favourite
1454 editor and save them back there.  If any file contains non-ASCII
1455 characters ensure you save it in UTF-8 format.  Git will detect
1456 any changes whenever you restart Git GUI and the file names will
1457 then be listed in the Unstaged Changes panel.  Or you can click
1458 the Rescan button to refresh the panel contents at any time.  You
1459 may break off and resume editing any time.
1460
1461 The changes you have made may be displayed in diff form in the top
1462 right-hand panel of Git GUI by clicking on the file name shown in
1463 one of the left panels.
1464
1465 When your editing is complete, move the files from being Unstaged
1466 to Staged by clicking the document symbol to the left of each
1467 name.  If you change your mind it can be moved back by clicking on
1468 the ticked box to the left of the name.
1469
1470 Finally the changes you have made may be committed to your
1471 @q{master} branch by entering a brief message in the Commit
1472 Message box and clicking the Commit button.
1473
1474 If you wish to amend your changes after a commit has been made,
1475 the original version and the changes you made in that commit may
1476 be recovered by selecting
1477
1478 @example
1479 Commit -> Amend Last Commit
1480 @end example
1481
1482 @noindent
1483 or by checking the Amend Last Commit radio button at bottom right.
1484 This will return the changes to the Staged state, so further
1485 editing made be carried out within that commit.  This must only be
1486 done @emph{before} the changes have been Pushed or sent to your
1487 mentor for Pushing - after that it is too late and corrections
1488 have to be made as a separate commit.
1489
1490
1491 @subsection Sending changes to @q{remotes/origin/master}
1492
1493 If you do not have write access to @q{remotes/origin/master} you
1494 will need to send your changes by email to someone who does.
1495
1496 First you need to create a diff or patch file containing your
1497 changes.  To create this, the file must first be committed.  Then
1498 terminate the Git GUI.  In the git bash shell first cd to your Git
1499 repository with
1500
1501 @example
1502 cd [path]/Git
1503 @end example
1504
1505 if necessary, then produce the patch with
1506
1507 @example
1508 git format-patch origin
1509 @end example
1510
1511 This will create a patch file for all the locally committed files
1512 which differ from @q{origin/master}.  The patch file can be found
1513 in [path]/Git and will have a name formed from the commit message.
1514
1515 @subsection Resolving merge conflicts
1516
1517 As soon as you have committed a changed file your local
1518 @code{master} branch has diverged from @code{origin/master}, and
1519 will remain diverged until your changes have been committed in
1520 @code{remotes/origin/master} and Fetched back into your
1521 @code{origin/master} branch.  Similarly, if a new commit has been
1522 made to @code{remotes/origin/master} by someone else and Fetched,
1523 your local @code{master} branch is divergent.  You can detect a
1524 divergent branch by clicking on
1525
1526 @example
1527 Repository -> Visualise all branch history
1528 @end example
1529
1530 This opens up a very useful new window called @q{gitk}.  Use this
1531 to browse all the commits made by yourself and others.
1532
1533 If the diagram at top left of the resulting window does not show
1534 your @code{master} tag on the same node as the
1535 @code{remotes/origin/master} tag your branch has diverged from
1536 @code{origin/master}.  This is quite normal if files you have
1537 modified yourself have not yet been Pushed to
1538 @code{remotes/origin/master} and Fetched, or if files modified and
1539 committed by others have been Fetched since you last Merged
1540 @code{origin/master} into your local @code{master} branch.
1541
1542 If a file being merged from @code{origin/master} differs from one
1543 you have modified in a way that cannot be resolved automatically
1544 by git, Merge will report a Conflict which you must resolve by
1545 editing the file to create the version you wish to keep.
1546
1547 This could happen if the person updating
1548 @code{remotes/origin/master} for you has added some changes of his
1549 own before committing your changes to
1550 @code{remotes/origin/master}, or if someone else has changed the
1551 same file since you last fetched the file from
1552 @code{remotes/origin/master}.
1553
1554 Open the file in your editor and look for sections which are
1555 delimited with ...
1556
1557 [to be completed when I next have a merge conflict to be sure I
1558 give the right instructions  -td]
1559
1560
1561 @subsection Other actions
1562
1563 The instructions above describe the simplest way of using git on
1564 Windows.  Other git facilities which may usefully supplement these
1565 include
1566
1567 @itemize
1568 @item Using multiple local branches (Create, Rename, Delete)
1569 @item Resetting branches
1570 @item Cherry-picking commits
1571 @item Pushing commits to @w{remote/origin/master}
1572 @item Using gitk to review history
1573 @end itemize
1574
1575 Once familiarity with using git on Windows has been gained the
1576 standard git manuals can be used to learn about these.
1577
1578
1579 @node Repository directory structure
1580 @section Repository directory structure
1581
1582
1583 @c TODO: integrate the roadmap better
1584 @verbatiminclude ROADMAP
1585
1586
1587 @node Other Git documentation
1588 @section Other Git documentation
1589
1590 @itemize
1591 @item
1592 Official git man pages:
1593 @uref{http://www.kernel.org/pub/software/scm/git/docs/}
1594
1595 @item
1596 More in-depth tutorials: @uref{http://git-scm.com/documentation}
1597
1598 @item
1599 Book about git: @uref{http://progit.org/,Pro Git}
1600 @end itemize
1601