git submodule update vs git submodule sync -


the git documentation doesn't make @ clear difference between git submodule update , git submodule sync is. i'm not finding out on web. can me out difference here?

   update        update registered submodules match superproject expects        cloning missing submodules , updating working tree of        submodules. "updating" can done in several ways depending on        command line options , value of submodule.<name>.update        configuration variable. 

-

   sync        synchronizes submodules' remote url configuration setting value        specified in .gitmodules. affect submodules        have url entry in .git/config (that case when        initialized or freshly added). useful when submodule urls        change upstream , need update local repositories        accordingly. 

for reference, i'm using git client version 2.11.0

update doing git pull in each submodule (except without branch, since main repo specifies commit directly).

the tricky 1 sync. imagine clone project submodules, later upstream project changes 1 of submodules point different url.

your local copy of submodule still point old url, since git never allows remote repositories force change local configuration. need run git submodule sync apply remote repo's configuration local submodule repos.

note that, if making changes submodules, might want urls mismatch if upstream never changed them ... using multiple remote urls better idea case.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -