Install needed packages (on a Debian-based system):
apt-get install git make
apt-get install --no-install-recommends asciidoc

Generating git docbook documentation:
- Clone git
- apply patch
- change (system/global) asciidoc.conf
  - comment:
    lsquo=&#8216;
    rsquo=&#8217;
    ldquo=&#8220;
    rdquo=&#8221;
    (^-- )=&#8212;&#8201;
    (\n-- )|( -- )|( --\n)=&#8201;&#8212;&#8201;
    (\w)--(\w)=\1&#8212;\2
    (\w)'(\w)=\1&#8217;\2
- make xml
- take *.xml files

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 4f801f4..7b9fbf1 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -225,6 +225,8 @@ all: html man
 
 html: $(DOC_HTML)
 
+xml: cmd-list.perl $(MAN_XML) user-manual.xml
+
 man: man1 man5 man7
 man1: $(DOC_MAN1)
 man5: $(DOC_MAN5)
@@ -335,7 +337,7 @@ clean:
 	$(RM) GIT-ASCIIDOCFLAGS
 
 $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS)
-	$(QUIET_ASCIIDOC)$(TXT_TO_HTML) -d manpage -o $@ $<
+	$(QUIET_ASCIIDOC)$(TXT_TO_HTML) -d article -o $@ $<
 
 $(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS)
 	$(QUIET_ASCIIDOC)$(TXT_TO_HTML) -o $@ $<
@@ -347,10 +349,10 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
 	$(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
 
 %.xml : %.txt $(ASCIIDOC_DEPS)
-	$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<
+	$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d article -o $@ $<
 
 user-manual.xml: user-manual.txt user-manual.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
-	$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d book -o $@ $<
+	$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d article -o $@ $<
 
 technical/api-index.txt: technical/api-index-skel.txt \
 	technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index 3e4c139..7984fe9 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -9,6 +9,7 @@
 
 [macros]
 (?su)[\\]?(?P<name>linkgit):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
+(?su)[\\]?(?P<name>link):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
 
 [attributes]
 asterisk=&#42;
@@ -30,12 +31,109 @@ ifdef::backend-docbook[]
 {0#</citerefentry>}
 endif::backend-docbook[]
 
+ifdef::backend-docbook[]
+[header-declarations]
+<?xml version="1.0" encoding="{encoding}"?>
+<!DOCTYPE {doctype-article?sect2}{doctype-book?book}{doctype-manpage?refentry} SYSTEM "../../../dtd/dblite.dtd">
+
+ifdef::doctype-article[]
+[header]
+template::[header-declarations]
+
+<sect2 lang="{lang=en}" id="{doctitle}">
+template::[docinfo]
+<indexterm>
+<primary>{doctitle}</primary>
+</indexterm>
+
+[footer]
+</sect2>
+
+[callout-inlinemacro]
+# Callout.
+<co id="{docname}_{coid}"/>
+
+[listtags-callout]
+list=<calloutlist{id? id="{docname}_{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>{title?<title>{title}</title>}|</calloutlist>
+item=<callout arearefs="{docname}_{coids}">|</callout>
+text=<para>|</para>
+
+# [[id,text]]
+[anchor2-inlinemacro]
+<anchor id="{doctitle}_{1}" xreflabel="{2=[{1}]}"/>
+# [[[id]]]
+[anchor3-inlinemacro]
+<anchor id="{doctitle}_{1}" xreflabel="[{1}]"/>[{1}]
+# <<id,text>>
+[xref2-inlinemacro]
+<link linkend="{doctitle}_{1}">{2}</link>
+{2%}<xref linkend="{doctitle}_{1}"/>
+
+[appendix]
+<sect3{id? id="{doctitle}_{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
+<title>{title}</title>
+|
+</sect3>
+
+[linkgit-inlinemacro]
+{0%{target}}
+<xref linkend="{target}({0})" />
+
+[link-inlinemacro]
+{0%{target}}
+<ulink url="https://www.kernel.org/pub/software/scm/git/docs/{target}"><citetitle>{0}</citetitle></ulink>
+
+[sect1]
+<simplesect{id? id="{doctitle}_{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
+<title>{title}</title>
+|
+</simplesect>
+
+[sect2]
+<section{id? id="{doctitle}_{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
+<title>{title}</title>
+|
+</section>
+
+[sect3]
+<section{id? id="{doctitle}_{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
+<title>{title}</title>
+|
+</section>
+
+[sect4]
+<section{id? id="{doctitle}_{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
+<title>{title}</title>
+|
+</section>
+
+[literal-inlinemacro]
+# Inline literal.
+<emphasis>{passtext}</emphasis>
+
+# Paragraph substitution.
+[paragraph]
+<formalpara{id? id="{doctitle}_{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}><title>{title}</title><para>
+{title%}<simpara{id? id="{doctitle}_{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
+|
+{title%}</simpara>
+{title#}</para></formalpara>
+{empty}
+
+[quotes]
+ifdef::no-inline-literal[]
+`=literal
+endif::no-inline-literal[]
+
+endif::doctype-article[]
+endif::backend-docbook[]
+
 ifdef::backend-docbook[]
 ifdef::doctype-manpage[]
 # The following two small workarounds insert a simple paragraph after screen
 [listingblock]
 <example><title>{title}</title>
-<literallayout class="monospaced">
+<literallayout>
 |
 </literallayout><simpara></simpara>
 {title#}</example>
diff --git a/Documentation/user-manual.conf b/Documentation/user-manual.conf
index 0148f12..d10b762 100644
--- a/Documentation/user-manual.conf
+++ b/Documentation/user-manual.conf
@@ -7,5 +7,63 @@ startsb=&#91;
 endsb=&#93;
 tilde=&#126;
 
+[header]
+template::[header-declarations]
+
+<sect2 lang="{lang=en}" id="git_user-manual">
+template::[docinfo]
+
 [linkgit-inlinemacro]
-<ulink url="{target}.html">{target}{0?({0})}</ulink>
+<xref linkend="{target}{0?({0})}" />
+
+# [[id,text]]
+[anchor2-inlinemacro]
+<anchor id="{doctitle}_{1}" xreflabel="{2=[{1}]}"/>
+# [[[id]]]
+[anchor3-inlinemacro]
+<anchor id="{doctitle}_{1}" xreflabel="[{1}]"/>[{1}]
+# <<id,text>>
+[xref2-inlinemacro]
+<link linkend="{doctitle}_{1}">{2}</link>
+{2%}<xref linkend="{doctitle}_{1}"/>
+
+[preface]
+<section{id? id="{doctitle}_{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
+<title>{title}</title>
+|
+</section>
+
+[sect1]
+<section{id? id="{doctitle}_{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
+<title>{title}</title>
+|
+</section>
+
+[sect2]
+<section{id? id="{doctitle}_{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
+<title>{title}</title>
+|
+</section>
+
+[listingblock]
+<example><title>{title}</title>
+<literallayout>
+ifdef::doctype-manpage[]
+&#10;.ft C&#10;
+endif::doctype-manpage[]
+|
+ifdef::doctype-manpage[]
+&#10;.ft&#10;
+endif::doctype-manpage[]
+</literallayout>
+{title#}</example>
+
+ifdef::doctype-manpage[]
+# The following two small workarounds insert a simple paragraph after screen
+[listingblock]
+<example><title>{title}</title>
+<literallayout>
+|
+</literallayout><simpara></simpara>
+{title#}</example>
+endif::doctype-manpage[]
