]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/devel/git-starting.itexi
Merge commit 'origin/dev/jneeman' into systems-per-page
[lilypond.git] / Documentation / devel / git-starting.itexi
1 @c -*- coding: us-ascii; mode: texinfo; -*-
2 @node Starting with git
3 @chapter Starting with git
4
5 To complete or present in another form the introduction to Git usage
6 in this chapter, it may be a good idea to look for Git documentation
7 at @uref{http://git-scm.com/documentation}, 
8
9 @menu
10 * Getting the source code::     
11 * Updating the source code::    
12 * Working with several Git branches::  
13 * Sharing your changes::        
14 * Other interesting Git commands::  
15 * Git on Windows::              
16 @end menu
17
18
19 @node Getting the source code
20 @section Getting the source code
21
22 @menu
23 * Git introduction::            
24 * Main source code::            
25 * Website source code::         
26 * Documentation translations source code::  
27 * Other branches::              
28 * Other locations for git::     
29 * Git user configuration::      
30 @end menu
31
32 @node Git introduction
33 @subsection Git introduction
34
35 The source code is kept in a Git respository.  This allows us to
36 track changes to files, and for multiple people to work on the
37 same set of files efficiently.
38
39 @warning{These instructions assume that you are using the
40 command-line version of Git 1.5 or higher.  Windows users should
41 skip to @ref{Git on Windows}.}
42
43
44 @node Main source code
45 @subsection Main source code
46
47 To get the main source code and documentation,
48
49 @c WARNING: when updating the commands below, please
50 @c update the other flavors in the two next nodes
51 @c and in Introduction to Git concepts
52 @smallexample
53 mkdir lilypond; cd lilypond
54 git init-db
55 git remote add -f -t master -m master origin git://git.sv.gnu.org/lilypond.git/
56 git checkout -b master origin/master
57 @end smallexample
58
59
60 @node Website source code
61 @subsection Website source code
62
63 To get the website (including translations),
64
65 @smallexample
66 mkdir lilypond-web ; cd lilypond-web
67 git init-db
68 git remote add -f -t web -m web origin git://git.sv.gnu.org/lilypond.git/
69 git checkout -b web origin/web
70 @end smallexample
71
72
73 @node Documentation translations source code
74 @subsection Documentation translations source code
75
76 To translate the documentation (@emph{not} the website),
77
78 @smallexample
79 mkdir lilypond-translation; cd lilypond-translation
80 git init-db
81 git remote add -f -t lilypond/translation -m lilypond/translation origin git://git.sv.gnu.org/lilypond.git/
82 git checkout -b lilypond/translation origin/lilypond/translation
83 @end smallexample
84
85
86 @node Other branches
87 @subsection Other branches
88
89 Most contributors will never need to touch the other branches.  If
90 you wish to do so, you will need more familiarity with git.
91
92 @itemize
93
94 @item @code{gub}:
95 This stores the Grand Unified Binary, our cross-platform building
96 tool.  
97 @c TODO: merge the gub stuff with this CG.
98 For more info, see @uref{http://lilypond.org/gub}.  The git
99 location is:
100
101 @example
102 http://github.com/janneke/gub
103 @end example
104
105 @item @code{dev/XYZ}:
106 These branches are for individual developers.  They store code
107 which is not yet stable enough to be added to the @code{master}
108 branch.
109
110 @item @code{stable/XYZ}:
111 The branches are kept for archival reasons.
112
113 @end itemize
114
115
116 @node Other locations for git
117 @subsection Other locations for git
118
119 If you have difficulty connecting to most of the repositories
120 listed in earlier sections, try:
121
122 @example
123 http://git.sv.gnu.org/r/lilypond.git
124 git://git.sv.gnu.org/lilypond.git
125 ssh://git.sv.gnu.org/srv/git/lilypond.git
126 @end example
127
128 Using HTTP protocol is slowest, so it is not recommended unless both
129 SSH and Git protocols fail, which happens e.g. if you connect to
130 internet through a router that filters out Git and/or SSH connections.
131
132
133 @node Git user configuration
134 @subsection Git user configuration
135
136 To configure git to automatically use your name and email address
137 for commits and patches,
138
139 @example
140 git config --global user.name "MYNAME"
141 git config --global user.email MYEMAIL@@EXAMPLE.NET
142 @end example
143
144
145 @node Updating the source code
146 @section Updating the source code
147
148 @menu
149 * Importance of updating::      
150 * Update command::              
151 * Resolving conflicts::         
152 * Introduction to Git concepts::  
153 @end menu
154
155
156 @node Importance of updating
157 @subsection Importance of updating
158
159 In a large project like LilyPond, contributors sometimes edit the same
160 file at the same time.  As long as everybody updates their version of
161 the file with the most recent changes (@emph{pulling}), there are
162 generally no problems with this multiple-person editing.  However,
163 boring problems can arise if you do not pull before attempting commit,
164 e.g. you may encounter a conflict; in this case, see @ref{Resolving
165 conflicts}.
166
167
168 @node Update command
169 @subsection Updating command
170
171 Whenever you are asked to pull, it means you should update your
172 local copy of the repository with the changes made by others on
173 the remote @code{git.sv.gnu.org} repository:
174
175 @example
176 git pull origin
177 @end example
178
179
180 @node Resolving conflicts
181 @subsection Resolving conflicts
182
183 Occasionally an update may result in conflicts -- this happens
184 when you and somebody else have modified the same part of the same
185 file and git cannot figure out how to merge the two versions
186 together.  When this happens, you must manually merge the two
187 versions.
188
189 If you need some documentation to understand and resolve conflicts,
190 see paragraphs @emph{How conflicts are presented} and @emph{How to
191 resolve conflicts} in @command{git merge} man page.
192
193
194 @node Introduction to Git concepts
195 @subsection Introduction to Git concepts
196
197 A bit of Git vocabulary will be explained below.  The following is
198 just introduction material; for better understanding of Git concepts,
199 you are invited to read further documentation, especially Git
200 Community Book at @uref{http://book.git-scm.com/}.
201
202 The @code{git pull origin} command above is just a shortcut for this
203 command:
204
205 @example
206 git pull git://git.sv.gnu.org/lilypond.git/ @var{branch}:origin/@var{branch}
207 @end example
208
209 @noindent
210 where @code{@var{branch}} is typically @code{master}, @code{web} or
211 @code{lilypond/translation}; if you do not know or remember, see
212 @ref{Getting the source code} to remember which commands you issued or
213 which source code you wanted to get.
214
215 A @emph{commit} is a set of changes made to the sources; it also
216 includes the committish of the parent commit, the name and e-mail of
217 the @emph{author} (the person who wrote the changes), the name and
218 e-mail of the @emph{committer} (the person who brings these changes
219 into the Git repository), and a commit message.
220
221 A @emph{committish} is the SHA1 checksum of a commit, a number made of
222 40 hexadecimal digits, which acts as the internal unique identifier
223 for this commit.  To refer to a particular revision, don't use vague
224 references like the (approximative) date, simply copy and paste the
225 committish.
226
227 A @emph{branch} is nothing more than a pointer to a particular commit,
228 which is called the @emph{head} of the branch; when referring to a
229 branch, one often acutally thinks about its head and the ancestor
230 commits of the head.
231
232 Now we will explain the two last commands you used to get the source
233 code from Git -- see @ref{Getting the source code}.
234
235 @example
236 git remote add -f -t @var{branch} -m @var{branch} origin git://git.sv.gnu.org/lilypond.git/
237 git checkout -b @var{branch} origin/@var{branch}
238 @end example
239
240 The @command{git remote} has created a branch called
241 @code{origin/@var{branch}} in your local Git repository.  As this
242 branch is a copy of the remote branch web from git.sv.gnu.org LilyPond
243 repository, it is called a @emph{remote branch}, and is meant to track
244 the changes on the branch from git.sv.gnu.org: it will be updated
245 every time you run @command{git pull origin} or @command{git fetch
246 origin}.
247
248 The @command{git checkout} command has created a branch named
249 @code{@var{branch}}.  At the beginning, this branch is identical to
250 @code{origin/@var{branch}}, but it will differ as soon as you make
251 changes, e.g. adding newly translated pages or editing some
252 documentation or code source file.  Whenever you pull, you merge the
253 changes from @code{origin/@var{branch}} and @code{@var{branch}} since
254 the last pulling.  If you do not have push (i.e. @qq{write}) access on
255 git.sv.gnu.org, your @code{@var{branch}} will always differ from
256 @code{origin/@var{branch}}.  In this case, remember that other people
257 working like you with the remote branch @code{@var{branch}} of
258 git://git.sv.gnu.org/lilypond.git/ (called @code{origin/@var{branch}}
259 on your local repository) know nothing about your own
260 @code{@var{branch}}: this means that whenever you use a committish or
261 make a patch, others expect you to take the latest commit of
262 @code{origin/@var{branch}} as a reference.
263
264 Finally, please remember to read the man page of every Git command you
265 will find in this manual in case you want to discover alternate
266 methods or just understand how it works.
267
268
269 @node Working with several Git branches
270 @section Working with several Git branches
271
272 It is possible to work with several branches on the same local Git
273 repository; this is especially useful for translators who may have to
274 deal with both @code{lilypond/translation} and a stable branch,
275 e.g. @code{stable/2.12}.
276
277 Some Git commands are introduced first, then a workflow with several
278 Git branches of LilyPond source code is presented.
279
280 @menu
281 * Git commands for managing several branches::  
282 * Working on LilyPond sources with several branches::  
283 @end menu
284
285 @node Git commands for managing several branches
286 @subsection Git commands for managing several branches
287
288 @subsubheading Listing branches and remotes
289
290 You can get the exact path or URL of all remotes with
291 running
292
293 @example
294 git remote -v
295 @end example
296
297 To list Git branches on your local repositories, run
298
299 @example
300 git branch     # list local branches only
301 git branch -r  # list remote branches
302 git branch -a  # list all branches
303 @end example
304
305
306 @subsubheading Checking out branches
307
308 To know the currently checked out branch, i.e. the branch whose source
309 files are present in your working tree, read the first line of the
310 output of
311
312 @example
313 git status
314 @end example
315
316 @noindent
317 The currently checked out branch is also marked with an asterisk in
318 the output of @command{git branch}.
319
320 You can check out another branch @code{@var{other_branch}}, i.e. check
321 out @code{@var{other_branch}} to the working tree, by running
322
323 @example
324 git checkout @var{other_branch}
325 @end example
326
327 Note that it is possible to check out another branch while having
328 uncommitted changes, but it is not recommended unless you know what
329 you are doing; it is recommended to run @command{git status} to check
330 this kind of issue before checking out another branch.
331
332
333 @subsubheading Merging branches
334
335 To merge branch @code{@var{foo}} into branch @code{@var{bar}}, i.e. to
336 @qq{add} all changes made in branch @code{@var{foo}} to branch
337 @code{@var{bar}}, run
338
339 @example
340 git checkout @var{bar}
341 git merge @var{foo}
342 @end example
343
344 If any conflict happens, see @ref{Resolving conflicts}.
345
346 There are common usage cases for merging: as a translator, you will
347 often want to merge @code{master} into @code{lilypond/translation}; on
348 the other hand, the Translations meister wants to merge
349 @code{lilypond/translation} into @code{master} whenever he has checked
350 that @code{lilypond/translation} builds successfully.
351
352
353 @node Working on LilyPond sources with several branches
354 @subsection Working on LilyPond sources with several branches
355
356 @subsubheading Fetching new branches from git.sv.gnu.org
357
358 To fetch and check out a new branch named @code{@var{branch}} on
359 git.sv.gnu.org, run from top of the Git repository
360
361 @example
362 git config --add remote.origin.fetch +refs/heads/@var{branch}:refs/remotes/origin/@var{branch}
363 git checkout --track -b @var{branch} origin/@var{branch}
364 @end example
365
366 After this, you can pull @code{@var{branch}} from git.sv.gnu.org with
367
368 @example
369 git pull origin
370 @end example
371
372 Note that this command generally fetches all branches you added with
373 @command{git remote add} (when you initialized the repository) or
374 @command{git config --add}, i.e. it updates all remote branches from
375 remote @code{origin}, then it merges the remote branch tracked by
376 current branch into current branch.  For example, if your current
377 branch is @code{master} --- which is the case if you got the sources
378 with the commands described in @ref{Main source code} and did not
379 issue any @command{git checkout} command --- @code{origin/master} will
380 be merged into @code{master}.
381
382
383 @subsubheading Local clones, or having several working trees
384
385 If you play with several Git branches, e.g. @code{master},
386 @code{lilypond/translation}, @code{stable/2.12}), you may want to have
387 one source and build tree for each branch; this is possible with
388 subdirectories of your local Git repository, used as local cloned
389 subrepositories.  To create a local clone for the branch named
390 @code{@var{branch}}, run
391
392 @example
393 git checkout @var{branch}
394 git clone -l -s -n . @var{subdir}
395 cd @var{subdir}
396 git reset --hard
397 @end example
398
399 Note that @code{@var{subdir}} must be a directory name which does not
400 already exist.  In @code{@var{subdir}}, you can use all Git commands
401 to browse revisions history, commit and uncommit changes; to update
402 the cloned subrepository with changes made on the main repository, cd
403 into @code{@var{subdir}} and run @command{git pull}; to send changes
404 made on the subrepository back to the main repository, run
405 @command{git push} from @code{@var{subdir}}.  Note that only one
406 branch (the currently checked out branch) is created in the
407 subrepository by default; it is possible to have several branches in a
408 subrepository and do usual operations (checkout, merge, create,
409 delete...) on these branches, but this possibility is not detailed
410 here.
411
412 When you push @code{@var{branch}} from @code{@var{subdir}} to the main
413 repository, and @code{@var{branch}} is checked out in the main
414 repository, you must save uncommitted changes (see @command{git
415 stash}) and do @command{git reset --hard} in the main repository in
416 order to apply pushed changes in the working tree of the main
417 repository.
418
419
420 @node Sharing your changes
421 @section Sharing your changes
422
423 @menu
424 * Producing a patch::           
425 * Committing directly::         
426 @end menu
427
428
429 @node Producing a patch
430 @subsection Producing a patch
431
432 Once you have finished editing your files, checked that your changes
433 meet the @ref{Code style}, and/or @ref{Documentation policy}, properly
434 set up your name and email in @ref{Git user configuration}, and
435 checked that the entire thing compiles, you may
436
437 @example
438 git commit -a 
439 git format-patch origin
440 @end example
441
442 Send an email to @email{lilypond-devel@@gnu.org} with the diff as
443 an attachment.
444
445
446 @node Committing directly
447 @subsection Committing directly
448
449 Most contributors do not have permission to commit directly.  If you
450 do, make sure you have set up your name and email in @ref{Git user
451 configuration}, then edit @file{.git/config}: change the line
452
453 @example
454         url = git://git.sv.gnu.org/lilypond.git/
455 @end example
456
457 @noindent
458 into
459 @example
460         url = ssh://@var{user}@@git.sv.gnu.org/srv/git/lilypond.git
461 @end example
462
463 @noindent
464 where @var{user} is your login name on Savannah.
465
466 If you have not already done so, you should generate and upload a SSH
467 key: open @uref{https://savannah.gnu.org/my/} in your browser, then go to
468 @q{Preferences} then to something like @q{Edit SSH Keys}, and follow
469 the instructions on that page.
470
471 You may then
472
473 @example
474 git push origin
475 @end example
476
477
478 @node Other interesting Git commands
479 @section Other interesting Git commands
480
481 @menu
482 * Git log::                     
483 * Applying git patches::        
484 @end menu
485
486
487 @node Git log
488 @subsection Git log
489
490 The commands above don't only bring you the latest version of the
491 sources, but also the full history of revisions (revisons, also
492 called commits, are changes made to the sources), stored in the
493 .git directory.  You can browse this history with
494
495 @example
496 git log     # only shows the logs (author, committish and commit message)
497 git log -p  # also shows diffs
498 gitk        # shows history graphically
499 @end example
500
501 @warning{The @code{gitk} command may require a separate @code{gitk} package,
502 available in the appropriate distribution's repositories.}
503
504 @node Applying git patches
505 @subsection Applying git patches
506
507 Well-formed git patches should be committed with
508
509 @example
510 git am
511 @end example
512
513 Patches created without @code{git format-patch} should be
514 committed with
515
516 @example
517 git apply
518 @end example
519
520
521
522 @node Git on Windows
523 @section Git on Windows
524
525 @c Some of this may duplicate stuff in other sections
526 @c Clear this up later  -td
527
528 @subsection Background to nomenclature
529
530 Git is a system for tracking the changes made to source files by
531 a distributed set of editors.  It is designed to work without a
532 master repository, but we have chosen to have a master respository
533 for LilyPond files.  Editors hold local copies of the master
534 repository together with any changes they have made locally.  Local
535 changes are held in a local @q{branch}, of which there may be
536 several, but these instructions assume you are using just one.  The
537 files visible in the local repository always correspond to those
538 on the currently @q{checked out} local branch.
539
540 Files are edited on a local branch, and in that state the
541 changes are said to be @q{unstaged}.  When editing is complete, the
542 changes are moved to being @q{staged for commit}, and finally the
543 changes are @q{committed} to the local branch.  Once
544 committed, the changes are given a unique reference number called the
545 @q{Committish} which identifies them to Git.  Such committed changes
546 can be sent to the master repository by @q{pushing} them (if you
547 have write permission) or by sending them by email to someone who
548 has, either complete or as a @q{diff} or @q{patch} (which send
549 just the differences from master).
550
551 @subsection Installing git
552
553 Obtain Git from
554 @uref{http://code.google.com/p/msysgit/downloads/list}.
555 (Note, not msysGit, which is for Git developers) and
556 install.
557
558 Start Git by clicking on the desktop icon.
559 This will bring up a command line bash shell.  This may be
560 unfamiliar to Windows users.  If so, follow these
561 instructions carefully.  Commands are entered at a $ prompt
562 and are terminated by keying a newline.
563
564 @subsection Initialising Git
565
566 Decide where you wish to place your local Git repository,
567 creating the folders in Windows as necessary.  Here we
568 call the folder to contain the repository [path]/Git.
569 You will need to have space for around 150Mbytes.
570
571 In the git bash shell type
572
573 @example
574 cd [path]/Git
575 @end example
576
577 to position the shell at your new Git repository.
578
579 Note: if [path] contains folders with names containing
580 spaces use
581
582 @example
583 cd "[path]/Git"
584 @end example
585
586 Then type
587
588 @example
589 git init
590 @end example
591
592 to initialize your Git repository.
593
594 Then type (all on one line; the shell will wrap automatically)
595
596 @example
597 git remote add -f -t master origin git://git.sv.gnu.org/lilypond.git
598 @end example
599
600 to download the lilypond master files.
601
602 @warning{Be patient!  Even on a broadband connection this can take
603 10 minutes or more.  Wait for lots of [new tag] messages
604 and the $ prompt.}
605
606 We now need to generate a local copy of the downloaded files
607 in a new local branch.  Your local branch needs to have a
608 name, here we call it @q{lily-local} - you may wish to make up
609 your own.
610
611 Then, finally, type
612
613 @example
614 git checkout -b lily-local origin/master
615 @end example
616
617 to create the lily-local branch containing the local copies of the
618 master files.  You will be advised your local branch has been set
619 up to track the remote branch.
620
621 Return to Windows Explorer and look in your Git repository.  You
622 should see lots of folders.  For example, the LilyPond documentation
623 can be found in Git/Documentation/user.
624
625 Terminate the Git bash shell by typing @code{exit}.
626
627 @subsection Git GUI
628
629 Almost all subsequent work will use the Git Graphical User
630 Interface, which avoids having to type command line
631 commands. To start Git GUI first start the Git bash shell by
632 clicking on the desktop icon, and type
633
634 @example
635 cd [path]/Git
636 git gui
637 @end example
638
639 The Git GUI will open in a new window.  It contains four panels
640 and 7 pull-down menus.  At this stage do not use any of the
641 commands under Branch, Commit, Merge or Remote.  These will
642 be explained later.
643
644 The two panels on the left contain the names of files which
645 you are in the process of editing (Unstaged Changes), and
646 files you have finished editing and have staged ready for
647 committing (Staged Changes).  At this stage these panels will
648 be empty as you have not yet made any changes to any file.
649 After a file has been edited and saved the top panel on the right
650 will display the differences between the edited file selected
651 in one of the panels on the left and the last version committed.
652
653 The final panel at bottom right is used to enter a descriptive
654 message about the change before committing it.
655
656 The Git GUI is terminated by entering CNTL-Q while it is the
657 active window or by clicking on the usual Windows close-window
658 widget.
659
660 @subsection Personalising your local git repository
661
662 Open the Git GUI, click on
663
664 @example
665 Edit -> Options
666 @end example
667
668 and enter your name and email address in the
669 left-hand (Git Repository) panel.  Leave everything
670 else unchanged and save it.
671
672 @subsection Checking out a branch
673
674 At this stage you have two branches in your local repository,
675 both identical.  To see them click on
676
677 @example
678 Branch -> Checkout
679 @end example
680
681 You should have one local branch called @w{lily-local} and one
682 tracking branch called @w{origin/master}.  The latter is your
683 local copy of the @w{remote/origin/master} branch in the master
684 LilyPond repository.  The @w{lily-local} branch is where you
685 will make your local changes.
686
687 When a particular branch is selected, i.e., checked out, the
688 files visible in your repository are changed to reflect the
689 state of the files on that branch.
690
691 @subsection Updating files from @w{remote/origin/master}
692
693 Before starting the editing of a file, ensure your local branches
694 contain the latest version in @w{remote/origin/master} by first
695 clicking
696
697 @example
698 Remote -> Fetch from -> origin
699 @end example
700
701 @noindent
702 in the Git GUI.
703
704 This will place the latest version of every file, including all the
705 changes made by others,
706 into the @q{origin/master} branch of the tracking branches
707 in your git repository.  You can see these files by checking
708 out this branch.  This will not affect any files you have
709 modified in your local branch.
710
711 You then need to merge these fetched files into your local
712 branch by clicking on
713
714 @example
715 Merge -> Local Merge
716 @end example
717
718 @noindent
719 and if necessary select the local branch into which the merge
720 is to be made.
721
722 Note that a merge cannot be completed if there are any local
723 uncommitted changes on the lily-local branch.
724
725 This will update all the files in that branch to reflect the
726 current state of the @w{origin/master} branch.  If any of the
727 changes conflict with changes you have made yourself recently
728 you will be notified of the conflict (see below).
729
730 @subsection Editing files
731
732 First ensure your lily-local branch is checked out, then
733 simply edit the files in your local Git repository with your
734 favourite editor and save them back there.  If any file contains
735 non-ASCII characters ensure you save it in UTF-8 format.  Git will
736 detect any changes whenever you restart Git GUI and the file names
737 will then be listed in the Unstaged Changes panel.
738 Or you can click the Rescan button to refresh the panel
739 contents at any time.  You may break off and resume at
740 editing any time.
741
742 The changes you have made may be displayed in diff form
743 in the top right-hand panel by clicking on the name in
744 Git GUI.
745
746 When your editing is complete, move the files from being
747 Unstaged to Staged by clicking the document symbol to
748 the left of each name.  If you change your mind it can
749 be moved back by clicking on the ticked box to the
750 left of the name.
751
752 Finally the changes you have made may be committed to
753 your lily-local branch by entering a brief message in
754 the Commit Message box and clicking the Commit button.
755
756 If you wish to amend your changes after a commit has been
757 made, the original version and the changes you made in that
758 commit may be recovered by selecting
759
760 @example
761 Commit -> Amend Last Commit
762 @end example
763
764 @noindent
765 or by checking the Amend Last Commit radio button at bottom left.
766 This will return the changes to the Staged state, so further
767 editing made be carried out within that commit.  This must only be
768 done @emph{before} the changes have been Pushed or sent to your
769 mentor for Pushing - after that it is too late and corrections
770 have to be made as a separate commit.
771
772
773 @subsection Sending changes to remote/origin/master
774
775 If you do not have write access to @w{remote/origin/master} you will
776 need to send your changes by email to someone who does.
777
778 First you need to create a diff or patch file containing
779 your changes.  To create this, the file must first be
780 committed.  Then terminate the Git GUI.  In the
781 git bash shell first cd to your Git repository with
782
783 @example
784 cd [path]/Git
785 @end example
786
787 if necessary, then produce the patch with
788
789 @example
790 git format-patch origin
791 @end example
792
793 This will create a patch file for all the locally committed files
794 which differ from @w{origin/master}.  The patch file can be found
795 in [path]/Git and will have a name formed from n and the commit
796 message.
797
798 @subsection Resolving merge conflicts
799
800 As soon as you have committed a changed file your local
801 branch has diverged from @w{origin/master}, and will
802 remain diverged until your changes have been committed
803 in @w{remote/origin/master} and Fetched back into your
804 @w{origin/master}.  Similarly, if a new commit has been made
805 to @w{remote/origin/master} by someone else and Fetched, your
806 lily-local branch is divergent.  You can detect a divergent
807 branch by clicking on
808
809 @example
810 Repository -> Visualise all branch history
811 @end example
812
813 This opens up a very useful new window called @q{gitk}.
814 Use this to browse all the commits made by others.
815
816 If the diagram at top left of the resulting window
817 does not show your branch's tag on the same node as
818 the @w{remote/origins/master} tag your branch has diverged from
819 @w{origin/master}.  This is quite normal if files you have modified
820 yourself have not yet been Pushed to @w{remote/origin/master} and
821 Fetched, or if files modified and committed by others have been
822 Fetched since you last Merged @w{origin/master} into your lily-local
823 branch.
824
825 If a file being merged from @w{origin/master} differs from
826 one you have modified in a way that cannot be resolved
827 automatically by git, Merge will report a Conflict
828 which you must resolve by editing the file to create the
829 version you wish to keep.
830
831 This could happen if the person updating @w{remote/origin/master}
832 for you has added some changes of his own before
833 committing your changes to @w{remote/origin/master}, or if someone
834 else has changed the same file since you last
835 fetched the file from @w{remote/origin/master}.
836
837 Open the file in your editor and look for sections which
838 are delimited with ...
839
840 [to be completed when I next have a merge conflict to be
841 sure I give the right instructions  -td]
842
843
844 @subsection Other actions
845
846 The instructions above describe the simplest way of using
847 git on Windows.  Other git facilities which may usefully
848 supplement these include
849
850 @itemize
851
852 @item Using multiple local branches (Create, Rename, Delete)
853 @item Resetting branches
854 @item Cherry-picking commits
855 @item Pushing commits to @w{remote/origin/master}
856 @item Using gitk to review history
857
858 @end itemize
859
860 Once familiarity with using git on Windows has been gained the
861 standard git manuals can be used to learn about these.