Skip to main content

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 Superblocks CLI

warning

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 i -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
info

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 tools

Initialize the Applications you want to sync to your repository by running:

superblocks init

Select tools

Use your arrow keys ↑↓ or type the name of an Application, Workflow, or Scheduled Job to find it in the list of options.

Press Space to select your tool. You can select multiple tools to initialize at once. When you're done press Enter to continue.

Choose changes to export

After choosing tools, you'll be prompted to select the version to export.

  • Latest edits: this will export all committed and uncommitted changes. Choose this option if you're initializing a new tool that doesn't have any commits

  • Most recent commit: this will export up to the most recent commit

  • Deployed: this will export the commit that's currently deployed for each selected tool. Choose this option if you're initializing an existing tool and want your team to review your undeployed changes

4. Push to your repo

Now that you've exported an initial state for your tools, 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>
success

You're now ready to start version controlling your Applications using Git.

What's next?