GIT-SUBMODULE(1) Git Manual GIT-SUBMODULE(1) (NAME) git-submodule - (SYNOPSIS) git submodule [--quiet] [--cached] git submodule [--quiet] add [] [--] [] git submodule [--quiet] status [--cached] [--recursive] [--] [...] git submodule [--quiet] init [--] [...] git submodule [--quiet] deinit [-f|--force] (--all|[--] ...) git submodule [--quiet] update [] [--] [...] git submodule [--quiet] set-branch [] [--] git submodule [--quiet] set-url [--] git submodule [--quiet] summary [] [--] [...] git submodule [--quiet] foreach [--recursive] git submodule [--quiet] sync [--recursive] [--] [...] git submodule [--quiet] absorbgitdirs [--] [...] (DESCRIPTION) . gitsubmodules(7) . (COMMANDS) . . add [-b ] [-f | --force] [--name ] [--reference ] [--ref-format ] [--depth ] [--] [] : << >> () . URL origin . URL ( ./ ../ ) ( foo.git bar.git ../foo.git ./foo.git - URL - URL Git ). . HEAD (detached) origin . . . (repo /path/to/repo.git foo host.xz:foo/.git). Git (stage) . --name . URL .gitmodules . URL URL . git-submodule URL .gitmodules . --ref-format (ref) . status [--cached] [--recursive] [--] [...] . SHA-1 git- describe(1) SHA-1 . SHA-1 : - + SHA-1 U (merge conflicts) . --cached SHA-1 . --recursive . HEAD git-status(1) git-diff(1) ( ). init [--] [...] ( ) submodule.$name.url .git/config .gitmodules . URL . (upstream) . . submodule.active . submodule.$name.update .gitmodules .git/config () .git/config () submodule.$name.update . URL .git/config git submodule update git submodule update --init init . add . deinit [-f | --force] (--all|[--] ...) (unregister) submodule.$name .git/config . git submodule update git submodule foreach git submodule sync . (pathspec) . --force . git-rm(1) . gitsubmodules(7) . update [--init] [--remote] [-N | --no-fetch] [--[no-]recommend-shallow] [-f | --force] [--checkout | --rebase | --merge] [--reference=] [--ref-format=] [--depth=] [--recursive] [--jobs ] [--[no-]single-branch] [--filter=] [--] [...] (fetch) . <<>> submodule..update . . checkout . (: .gitmodules .gitmodules git submodule init ). update submodule..update : checkout HEAD (detached) . --force ( git checkout --force) . rebase (rebase) . merge (merge) . : ! . submodule..update ! . .gitmodules . none . . .gitmodules --init . --recursive . --ref-format . --filter . git-rev-list(1) . set-branch (-b|--branch) [--] , set-branch (-d|--default) [--] . --branch . --default submodule..branch HEAD . set-url [--] URL . URL . summary [--cached | --files] [(-n|--summary-limit) ] [commit] [--] [...] ( HEAD) / . ( --cached) . --files ( --cached ). --submodule=log git-diff(1) . foreach [--recursive] . $name $sm_path $displaypath $sha1 $toplevel : $name .gitmodules $sm_path $displaypath $sha1 $toplevel . $PATH $path $sm_path . . foreach --quiet . --recursive ( ). . ||: . : git submodule foreach 'echo $sm_path `git rev-parse HEAD`' sync [--recursive] [--] [...] URL .gitmodules . URL .git/config ( ). URL . git submodule sync git submodule sync -- A A . --recursive . absorbgitdirs git git $GIT_DIR/modules git core.worktree .git git git . git git . . (OPTIONS) -q, --quiet . --progress -q . . add update . --all . deinit . -b, --branch= . submodule..branch .gitmodules update --remote . . . HEAD . -f, --force . add deinit update . add . . git submodule add ( ) . --force ( child child1 ) . deinit . update ( ) . --cached HEAD . status summary . --files summary HEAD . -n, --summary-limit= summary ( ) . 0 (). . // 1 . --remote SHA-1 . update . (branch..remote) origin . HEAD submodule..branch .gitmodules .git/config ( .git/config) . (--checkout --rebase ) . SHA-1 . submodule update --remote --merge submodule update --merge gitlink . update --remote SHA-1 . submodule update --remote --no-fetch . HEAD . git pull : update --remote submodule..branch git pull branch..merge . submodule..branch branch..merge . -N, --no-fetch . update . --checkout HEAD . update . submodule..update checkout . submodule..update checkout . --merge . update . HEAD . . submodule..update merge . --rebase (rebase) . update . HEAD . git-rebase(1) . submodule..update rebase . --init git submodule init . update . --name= . / . --reference= . add update . . git-clone(1) . (Note) --reference --shared --dissociate git-clone(1) . --dissociate . add update . . git-clone(1) . (Note) --reference . --recursive . foreach update status sync . ( ) . --depth= (shallow) . add update . git-clone(1) . --recommend-shallow, --no-recommend-shallow . update . submodule..shallow .gitmodules . --no-recommend-shallow . -j, --jobs= . update . submodule.fetchJobs . --single-branch, --no-single-branch : HEAD --branch . update . ... () . . ( add ). (FILES) .gitmodules URL . $GIT_DIR/config . URL submodule..url. gitmodules(5) . (SEE ALSO) gitsubmodules(7), gitmodules(5). (GIT) git(1) Git 2.55.0 2026-06-29 GIT-SUBMODULE(1)