274 captures
22 Jun 2012 - 19 Feb 2026
Jul AUG Sep
26
2020 2021 2022
success
fail

About this capture

COLLECTED BY

Collection: Wikipedia Eventstream

TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20210826131421/https://git-scm.com/docs/gitmodules
 
Git





About  

Branching and Merging  

Small and Fast  

Distributed  

Data Assurance  

Staging Area  

Free and Open Source  

Trademark  



Documentation  

Reference  

Book  

Videos  

External Links  



Downloads  

GUI Clients  

Logos  



Community  



English 
 
Localized versions of gitmodules manual
 


(一) English  


Topics 


Setup and Config



git

config

help

bugreport

Getting and Creating Projects



init

clone

Basic Snapshotting



add

status

diff

commit

notes

restore

reset

rm

mv

Branching and Merging



branch

checkout

switch

merge

mergetool

log

stash

tag

worktree

Sharing and Updating Projects



fetch

pull

push

remote

submodule

 

Inspection and Comparison



show

log

diff

difftool

range-diff

shortlog

describe

Patching



apply

cherry-pick

diff

rebase

revert

Debugging



bisect

blame

grep

Email



am

apply

format-patch

send-email

request-pull

External Systems



svn

fast-import

Server Admin



daemon

update-server-info

 

Guides



gitattributes

Command-line interface conventions

Everyday Git

Frequently Asked Questions (FAQ)

Glossary

Hooks

gitignore

gitmodules

Revisions

Submodules

Tutorial

Workflows

All guides...

Administration



clean

gc

fsck

reflog

filter-branch

instaweb

archive

bundle

Plumbing Commands



cat-file

check-ignore

checkout-index

commit-tree

count-objects

diff-index

for-each-ref

hash-object

ls-files

ls-tree

merge-base

read-tree

rev-list

rev-parse

show-ref

symbolic-ref

update-index

update-ref

verify-pack

write-tree

 


Version 2.33.0    gitmodules last updated in 2.33.0
 
Changes in the gitmodules manual
 


(一)2.33.0 no changes

(二) 2.32.0   06/06/21  

(三)2.30.2  2.31.1 no changes

(四) 2.30.1   02/08/21  

(五)2.28.1  2.30.0 no changes

(六) 2.28.0   07/27/20  

(七)2.25.1  2.27.1 no changes

(八) 2.25.0   01/13/20  

(九)2.24.2  2.24.4 no changes

(十) 2.24.1   12/06/19  

(11) 2.24.0   11/04/19  

(12)2.23.2  2.23.4 no changes

(13) 2.23.1   12/06/19  

(14) 2.23.0   08/16/19  

(15)2.22.3  2.22.5 no changes

(16) 2.22.2   12/06/19  

(17)2.22.1 no changes

(18) 2.22.0   06/07/19  

(19)2.21.2  2.21.4 no changes

(20) 2.21.1   12/06/19  

(21) 2.21.0   02/24/19  

(22)2.20.3  2.20.5 no changes

(23) 2.20.2   12/06/19  

(24)2.20.1 no changes

(25) 2.20.0   12/09/18  

(26)2.19.4  2.19.6 no changes

(27) 2.19.3   12/06/19  

(28) 2.19.2   11/21/18  

(29)2.19.1 no changes

(30) 2.19.0   09/10/18  

(31)2.18.3  2.18.5 no changes

(32) 2.18.2   12/06/19  

(33)2.18.1 no changes

(34) 2.18.0   06/21/18  

(35)2.17.4  2.17.6 no changes

(36) 2.17.3   12/06/19  

(37)2.17.1  2.17.2 no changes

(38) 2.17.0   04/02/18  

(39)2.16.6 no changes

(40) 2.15.4   12/06/19  

(41)2.14.6 no changes

(42) 2.13.7   05/22/18  

(43)2.11.4  2.12.5 no changes

(44) 2.10.5   09/22/17  

(45) 2.9.5   07/30/17  

(46)2.4.12  2.8.6 no changes

(47) 2.3.10   09/28/15  

(48) 
 

Check your version of git by running
 git --version  



NAME



gitmodules - Defining submodule properties




SYNOPSIS




$GIT_WORK_TREE/.gitmodules




DESCRIPTION




The .gitmodules file, located in the top-level directory of a Git working tree, is a text file with a syntax matching the requirements of git-config[1].

The file contains one subsection per submodule, and the subsection value is the name of the submodule. The name is set to the path where the submodule has been added unless it was customized with the --name option of git submodule add. Each submodule section also contains the following required keys:




 submodule.<name>.path 


Defines the path, relative to the top-level directory of the Git working tree, where the submodule is expected to be checked out. The path name must not end with a /. All submodule paths must be unique within the .gitmodules file.


 submodule.<name>.url 


Defines a URL from which the submodule repository can be cloned. This may be either an absolute URL ready to be passed to git-clone[1] or (if it begins with ./or../) a location relative to the superprojects origin repository.





In addition, there are a number of optional keys:




 submodule.<name>.update 


Defines the default update procedure for the named submodule, i.e. how the submodule is updated by the git submodule update command in the superproject. This is only used by git submodule init to initialize the configuration variable of the same name. Allowed values here are checkout, rebase, mergeornone. See description of update command in git-submodule[1] for their meaning. For security reasons, the !command form is not accepted here.


 submodule.<name>.branch 


A remote branch name for tracking updates in the upstream submodule. If the option is not specified, it defaults to the remote HEAD. A special value of . is used to indicate that the name of the branch in the submodule should be the same name as the current branch in the current repository. See the --remote documentation in git-submodule[1] for details.


 submodule.<name>.fetchRecurseSubmodules 


This option can be used to control recursive fetching of this submodule. If this option is also present in the submodules entry in .git/config of the superproject, the setting there will override the one found in .gitmodules. Both settings can be overridden on the command line by using the --[no-]recurse-submodules option to git fetch and git pull.


 submodule.<name>.ignore 


Defines under what circumstances git status and the diff family show a submodule as modified. The following values are supported:





 all 


The submodule will never be considered modified (but will nonetheless show up in the output of status and commit when it has been staged).


 dirty 


All changes to the submodules work tree will be ignored, only committed differences between the HEAD of the submodule and its recorded state in the superproject are taken into account.


 untracked 


Only untracked files in submodules will be ignored. Committed differences and modifications to tracked files will show up.


 none 


No modifications to submodules are ignored, all of committed differences, and modifications to tracked and untracked files are shown. This is the default option.





If this option is also present in the submodules entry in .git/config of the superproject, the setting there will override the one found in .gitmodules.


Both settings can be overridden on the command line by using the --ignore-submodules option. The git submodule commands are not affected by this setting.





 submodule.<name>.shallow 


When set to true, a clone of this submodule will be performed as a shallow clone (with a history depth of 1) unless the user explicitly asks for a non-shallow clone.






NOTES




Git does not allow the .gitmodules file within a working tree to be a symbolic link, and will refuse to check out such a tree entry. This keeps behavior consistent when the file is accessed from the index or a tree versus from the filesystem, and helps Git reliably enforce security checks of the file contents.




EXAMPLES




Consider the following .gitmodules file:



[submodule "libfoo"]
 path = include/foo
 url = git://foo.com/git/lib.git

[submodule "libbar"]
 path = include/bar
 url = git://bar.com/git/lib.git




This defines two submodules, libfoo and libbar. These are expected to be checked out in the paths include/foo and include/bar, and for both submodules a URL is specified which can be used for cloning the submodules.




SEE ALSO




git-submodule[1], gitsubmodules[7], git-config[1]




GIT




Part of the git[1] suite



 



About this site
 Patches, suggestions, and comments are welcome.  

Git is a member of Software Freedom Conservancy