Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
# The Try-it has no network, so a local folder "library" plays the part # of https://github.com/example/library.git. Git only allows submodules # from local folders when protocol.file.allow is set: git config --global protocol.file.allow always # Set up the library repository git init -q library cd library echo "function hello() {}" > library.js git add library.js git commit -q -m "First version of the library" cd .. # Set up the project repository git init -q project cd project echo "
Hello World!
" > index.html git add index.html git commit -q -m "First commit" # Add the library as a submodule and commit it git submodule add ../library libs/library > /dev/null 2>&1 git commit -q -m "Add the library as a submodule" # Clone the project: the submodule folder is empty at first cd .. git clone -q project copy cd copy git submodule init git submodule update
Submodule 'libs/library' (/tmp/egmU6c/work/library) registered for path 'libs/library'
Cloning into '/tmp/egmU6c/work/copy/libs/library'...
done.
Submodule path 'libs/library': checked out 'fb4cf55ef15aa6b95ae930f20e4f5c9d5848c017'