Version Control in AI Workbench#

Overview#

AI Workbench uses Git under the hood and surfaces simple versioning features.

Installing the full application on a host will install or update both Git and Git-LFS.

You can use the Desktop App or CLI for simple versioning features, however it’s not a fully featured Git client.

For more complex Git workflows you should use Git natively or with a different Git client.

AI Workbench tracks projects on each host through a host specific inventory file.

AI Workbench updates an inventory file when you clone or create a repository using the Desktop App or CLI.

That inventory file is read by the application to know which repositories are managed.

However, a regular git clone won’t add the repository to the inventory. You need to clone it through the Desktop App or CLI to add it to the inventory.

Key Concepts#

Managed Git

AI Workbench features that run Git commands under the hood for simple operations. Includes presentation and completion features like visualized file diffs and auto-generated commit messages.

Native Git

Running Git commands in the terminal or with a Git client instead of the AI Workbench features.

Managed Git#

Managed Git features are for reproducibility, not for complex Git operations.

Practically speaking, the managed features simplify:

  • Integrated commits: Committing environment configuration, code and data at the same time

  • Remote operations: Executing limited Git commands on a remote repository

  • Onboarding: Working with Git if you are new to it

Commiting a project in working stage in the Desktop App means the version will “just work” in the future. Breakdowns are confined to non-versioned dependency issues, e.g. packages aren’t pinned appropriately.

Managed Git provides simplified, end-to-end versioning.
  • Remote operations: Clone, push, fetch and pull

  • Branches: Create, switch and delete

  • Commits: Commit changes with editable auto-generated message

  • File diffs: File diff indicators with file viewing

  • Merges: Merge with conflict resolution UI

Managed Git is a hammer not a scalpel, so you should know when to use Git natively.

The invoked Git commands do not take arguments or flags. When this is inconvenient, you should work with Git natively.

Native Git#

If you need to do something not available in the managed Git features, just open a terminal.

The following are examples of when to use the terminal or Git client:

  • Rebasing

  • Interactive history editing

  • Creating branches at specific commits

  • Stashing and unstashing changes

Note that the end results of these operations are interpretable and managed by AI Workbench.

If you start a Git workflow in the terminal, then you should finish it in the terminal.

The managed Git features are unpredictable with intermediate Git states, and so switching midstream can cause unexpected behavior or errors in AI Workbench.

Examples are:

  • Starting a rebase in the terminal but trying to resolve conflicts in the Desktop App may raise errors and trigger undesired merge resolutions.

  • Staging files in the terminal but committing in the Desktop App is unpredictable because of how it it handles the index

However, managed Git recognizes clean Git states.

You can create a new branch from a commit or reset a branch onto a commit and the branches will work fine with managed Git. The terminal takes precedence and clean states are recognized.

Additionally, you can stash changes and switch branches with no problems, however trying to commit a branch with stashed changes in the Desktop App will result in problems.