Files
learning/git/git-submodules.txt
2022-05-06 00:50:02 +03:00

42 lines
827 B
Plaintext
Executable File

add submodule:
git submodule add [url]
config:
diff:
git config --global diff.submodule log
(git diff --submodule)
status:
git config status.submodulesummary 1
submodule commands:
git config submodule.recurse true
cloning:
git clone [url]
git submodule init
git submodule update / git submodule update --init
or
git clone --recurse-submodules [url]
change branch:
git config -f .gitmodules submodule.[name].branch [branch]
fetch updates for submodules
git submodule update --remote [name] (first update)
git submodule update --init --recursive (update all)
git submodule update --remote --merge (fetch and merge)
git pull --recurse-submodules
in case url changed:
git submodule sync --recursive
upload updates for submodules:
git push --recurse-submodules=(check/on-demand)
other:
git submodule foreach '[command]'