MicroticaMicrotica

Git commands

List your connected Git accounts, their repositories, and branches with the Microtica CLI to wire up pipelines and components.

The git commands read your connected Git integrations. Use them to find the account id, repository URL, and branch you need when creating a pipeline or scaffolding a component.

All git commands need a project id. Pass --project <id> or set MICROTICA_PROJECT_ID.

git accounts list

List the Git accounts connected to a project.

Terminal
microtica git accounts list
Output
id     name       type
-----  ---------  ---------
gh-1   acme       github
bb-1   acme       bitbucket

type is github or bitbucket. The id is what you pass as --account everywhere else.

git repos list

List the repositories accessible through a Git account.

Terminal
microtica git repos list --account <gitAccountId>
Output
id        fullName        url
--------  --------------  ----------------------------------
repo-123  acme/my-app     https://github.com/acme/my-app

The url is what pipeline create and git branches list expect — not the id.

git branches list

List the branches in a repository. Pass the repository URL to --repo, not its id.

Terminal
microtica git branches list --account <gitAccountId> --repo https://github.com/acme/my-app
Output
["main", "develop", "feature/x"]

Next steps

On this page