roblabs / xcode-continuous-integration

CI scripts for use in Xcode Continuous Integration *bots* 🤖. Also useful for manual builds.
https://RobLabs.com/xcode
MIT License
12 stars 1 forks source link

Notes on `git submodule` usage in XCS #6

Open roblabs opened 4 years ago

roblabs commented 4 years ago

Related to the sample for Siku — https://github.com/roblabs/xcode-continuous-integration/commit/1e13c1d264edeb7bcbf3364e73ed19797bcecbf6

Making some notes on the proper calls to pull in a git submodule with XCS. The main repo has a reference to a readme.md in the git submodule, and the hope was that XCS would pull in the submodule automatically. That did not work.

The two commands seem to work:

Subsequent attempts were to try the three git submodule, each with results listed below. Documentation in this font are from https://git-scm.com/docs/git-submodule


🟢git submodule sync

Synchronizing submodule url for 'Siku/Siku/Resources/siku-map-assets'

Synchronizes submodules' remote URL configuration setting to the value specified in .gitmodules. It will only affect those submodules which already have a URL entry in .git/config (that is the case when they are initialized or freshly added). This is useful when submodule URLs change upstream and you need to update your local repositories accordingly.


🔴 ~git submodule update --init --recursive~

fatal: No url found for submodule path 'siku-map-assets' in .gitmodules

If the submodule is not yet initialized, and you just want to use the setting as stored in .gitmodules, you can automatically initialize the submodule with the --init option. If --recursive is specified, this command will recurse into the registered submodules, and update any nested submodules within.


🟢git submodule update --remote

In order to ensure a current tracking branch state, update --remote fetches the submodule’s remote repository before calculating the SHA-1.