Skip to content

Commit ec48a76

Browse files
stefanbellergitster
authored andcommitted
submodule doc: reorder introductory paragraphs
It's better to start the man page with a description of what submodules actually are, instead of saying what they are not. Reorder the paragraphs such that - the first short paragraph introduces the submodule concept, - the second paragraph highlights the usage of the submodule command, - the third paragraph giving background information, and finally - the fourth paragraph discusing alternatives such as subtrees and remotes, which we don't want to be confused with. This ordering deepens the knowledge on submodules with each paragraph. First the basic questions like "How/what" will be answered, while the underlying concepts will be taught at a later time. Making sure it is not confused with subtrees and remotes is not really enhancing knowledge of submodules itself, but rather painting the big picture of git concepts, so you could also argue to have it as the second paragraph. Personally I think this may confuse readers, specially newcomers though. Additionally to reordering the paragraphs, they have been slightly reworded. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3d4a3ff commit ec48a76

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

Documentation/git-submodule.txt

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,17 @@ SYNOPSIS
2525

2626
DESCRIPTION
2727
-----------
28-
Submodules allow foreign repositories to be embedded within
29-
a dedicated subdirectory of the source tree, always pointed
30-
at a particular commit.
28+
Inspects, updates and manages submodules.
3129

32-
They are not to be confused with remotes, which are meant mainly
33-
for branches of the same project; submodules are meant for
34-
different projects you would like to make part of your source tree,
35-
while the history of the two projects still stays completely
36-
independent and you cannot modify the contents of the submodule
37-
from within the main project.
38-
If you want to merge the project histories and want to treat the
39-
aggregated whole as a single project from then on, you may want to
40-
add a remote for the other project and use the 'subtree' merge strategy,
41-
instead of treating the other project as a submodule. Directories
42-
that come from both projects can be cloned and checked out as a whole
43-
if you choose to go that route.
30+
A submodule allows you to keep another Git repository in a subdirectory
31+
of your repository. The other repository has its own history, which does not
32+
interfere with the history of the current repository. This can be used to
33+
have external dependencies such as third party libraries for example.
34+
35+
When cloning or pulling a repository containing submodules however,
36+
these will not be checked out by default; the 'init' and 'update'
37+
subcommands will maintain submodules checked out and at
38+
appropriate revision in your working tree.
4439

4540
Submodules are composed from a so-called `gitlink` tree entry
4641
in the main repository that refers to a particular commit object
@@ -51,19 +46,18 @@ describes the default URL the submodule shall be cloned from.
5146
The logical name can be used for overriding this URL within your
5247
local repository configuration (see 'submodule init').
5348

54-
This command will manage the tree entries and contents of the
55-
gitmodules file for you, as well as inspect the status of your
56-
submodules and update them.
57-
When adding a new submodule to the tree, the 'add' subcommand
58-
is to be used. However, when pulling a tree containing submodules,
59-
these will not be checked out by default;
60-
the 'init' and 'update' subcommands will maintain submodules
61-
checked out and at appropriate revision in your working tree.
62-
You can briefly inspect the up-to-date status of your submodules
63-
using the 'status' subcommand and get a detailed overview of the
64-
difference between the index and checkouts using the 'summary'
65-
subcommand.
66-
49+
Submodules are not to be confused with remotes, which are other
50+
repositories of the same project; submodules are meant for
51+
different projects you would like to make part of your source tree,
52+
while the history of the two projects still stays completely
53+
independent and you cannot modify the contents of the submodule
54+
from within the main project.
55+
If you want to merge the project histories and want to treat the
56+
aggregated whole as a single project from then on, you may want to
57+
add a remote for the other project and use the 'subtree' merge strategy,
58+
instead of treating the other project as a submodule. Directories
59+
that come from both projects can be cloned and checked out as a whole
60+
if you choose to go that route.
6761

6862
COMMANDS
6963
--------

0 commit comments

Comments
 (0)