+ To display the files modified by a patch (defaulting to the topmost
+ one):
+
+ stg files [<patch>]
+
+ To merge a GNU diff file (defaulting to the standard input) into the
+ topmost patch:
+
+ stg fold [<file>]
+
+ This command supports a '--threeway' option which applies the patch
+ onto the bottom of the topmost one and performs a three-way merge.
+
+
+Advanced Usage
+==============
+
+Configuration file
+------------------
+
+StGIT tries to read the configuration options from the following
+files: /etc/stgitrc, ~/.stgitrc and .git/stgitrc. The latter overrides
+the options in the former files. If no file is found, the defaults are
+used.
+
+An example configuration file with options description can be found in
+the examples/ directory. Most users would probably only define the
+'smtpserver' option used by the 'mail' command.
+
+The gitmergeonefile.py script does the three-way merging on individual
+files using the tool specified by the 'merger' option. The user can
+specify a smarter tool to be used.
+
+Templates
+---------
+
+The 'export' and 'mail' commands use templates for generating the
+patch files or e-mails. The default templates are installed under
+<prefix>/share/stgit/templates/ and, combined with the extra options
+available for the commands, should be enough for most users. The
+template format uses the standard Python string formatting rules. The
+variables available are shown in the the help message for the
+commands.
+
+The 'mail' command can also send an initial e-mail for which there is
+no default template. The <prefix>/share/stgit/examples/firstmail.tmpl
+file can be used as an example.
+
+A default description for new patches can be defined in the
+.git/patchdescr.tmpl file. This is useful for things like
+signed-off-by lines.
+
+Dealing with conflicts
+----------------------
+
+Pushing a patch on the stack can fail if the patch cannot be applied
+cleanly. This usually happens if there are overlapping changes in the
+tree, the patch depends on other patch which is not applied or if a
+patch was not merged upstream in the exact form it was sent.
+
+The 'push' operation will stop after the first patch with
+conflicts. The 'status' command shows the conflict files by marking
+them with a 'C'. If the 'keeporig' options is set to 'yes' (the
+default), the original files involved in the merge operations are left
+in the tree as <file>.older, <file>.local and <file>.remote for a
+better analysis by the user. If 'diff3' is used as the merger (the
+default), conflict markers can be found in the corresponding files as
+well.
+
+Once the conflict is fixed, the 'resolved' command has to be run to
+clear the conflict state. This command also removes the original files
+involved in the merge for a given file.
+
+Merging two patches into one
+----------------------------
+
+There is no command to do this directly at the moment but one can
+export the patch to be merged and use the 'stg fold' command on the
+generated diff file. Assuming that the merged patch was not already
+applied, the operation will succeed. Pushing the merged patch onto the
+stack will result in an empty patch (StGIT notifying the user) that
+can be safely deleted.
+
+
+.git/ Directory Structure
+=========================
+
+HEAD -> refs/heads/<something>
+objects/
+ ??/
+ ...