Golden Codes - armanexplorer planet

Practical code snippets for Django, Python, Bash, Git and All!

View on GitHub

Good Intro

update vs sync

Link

Sync Docs

Update: git submodule update updates the contents of the submodules. It is effectively running a "git fetch" and "git checkout" in each of your submodules.

Sync: git submodule sync updates the metadata about a submodule to reflect changes in the submodule URL. It re-synchronizes the information in .git/config with the information in .gitmodules.

update options

Reference

#‌ If it's the first time you check-out a repo you need to use --init first:
git submodule update --init --recursive

# For git 1.8.2 or above, the option --remote was added to support updating to latest tips of remote branches:
git submodule update --recursive --remote

clear remove of submodule

Link

add two differnet branch of a repo

git submodule add -b <branch A> --name <name A> <url> <path A>
git submodule add -b <branch B> --name <name B> <url> <path B>