Adding Applications to Source Control
Get started with Source Control in Superblocks by choosing the Applications you want to version control with Git. This is done by exporting an initial state of your Application to your local repository and pushing it to your Git provider.
Follow the steps below to learn how to use the Superblocks CLI to set up your repository.
1. Clone your repository
If you haven't already, clone your repository to your local computer and change your current working directory to the repo's location:
cd /path/to/local/repository
2. Install and login to the Superblocks CLI
To install the Superblocks CLI, make sure you have Node.js version 18.16.0 or later.
Run this command from any directory in your terminal:
npm install -g @superblocksteam/cli
This installs Superblocks CLI globally, so you can run superblocks
commands from any directory.
To login to Superblocks using the CLI, run:
superblocks login
The Superblocks CLI uses app.superblocks.com by default. If your organization uses Superblocks EU, change the domain by running superblocks config set domain eu.superblocks.com
.
3. Initialize Applications to your repository
Initialize the Applications you want to sync to your repository by running:
superblocks init
Select Applications
Use your arrow keys ↑↓
or type the name of an Application to find it in the list of options.
Press Space
to select an Application. You can select multiple Applications to initialize at once. When you're done press Enter
to continue.
Choose changes to export
After choosing Applications, you'll be prompted to select the version of your Apps to export.
-
Latest edits - this will export all committed and uncommitted changes to your Applications. Choose this option if you're initializing a new Application that doesn't have any commits.
-
Most recent commit - this will export up to the most recent commit for your Applications.
-
Deployed - this will export the commit that's currently deployed for each of the selected Applications. Choose this option if you're initializing an existing Application and want your team to code review undeployed commits.
4. Push to your repo
Now that you've exported an initial state for your Applications, commit your changes to the default branch you've configured for your repository.
git add .
git commit -m "commit message"
git push origin/<MY_BRANCH>
You're now ready to start version controlling your Applications using Git.