Skip to main content

Connect a Git repository to Infrahub

One of the three pillars Infrahub is built on is the idea of having unified storage for data and files. The data is stored in the graph database and the files are stored in Git.

When integrating a Git repository with Infrahub, the Git agent will ensure that both systems stay in sync at any time. Changes to branches or files in a Git repository will be synced to Infrahub automatically.

Please refer to Repository to learn more about it.

Fork & Clone the repository for the demo

Create a fork of the repository:

infrahub-demo-edge

info

The goal is to have a copy of this repository under your name. This way your testing won't affect other users.

Once you have created a fork in GitHub, you'll need a Personal Access Token to authorize Infrahub to access this repository.

How to create a Personal Access Token in GitHub

note

If you already cloned the repository in the past, ensure only the main branch is present in GitHub. If other branches are present, we recommend deleting them before continuing.

How to Delete a branch in GitHub
  1. Select the name of the active branch in the top left corner (usually main)
  2. Select View All Branches at the bottom of the popup
  3. Delete all branches but the branch main, with the trash icon on the right of the screen

View all Branches

Integrate the Git repository with Infrahub

Currently the easiest way to add a repository is to use the web interface.

Refer to Adding a repository guide.

After adding the infrahub-demo-edge repository you will be able to see several new Transformations and related objects:

Troubleshooting

If you don't see additional objects under the transformations or GraphQL Queries, it's possible that the Git agent might not be running anymore.

In this case, you should run invoke demo.start first to ensure that everything is working.