Version Control in AI Workbench#
Overview#
- AI Workbench doesn’t replace Git - It uses Git under the hood.
Installing the full AI Workbench application also installs (or updates) Git and Git-LFS. They are required for the managed versioning features.
However, AI Workbench is NOT a full Git client. You can’t use it to do everything you can do with Git.
- You MUST clone a project using AI Workbench to properly enter the project into inventory.
AI Workbench updates an inventory file when you clone/create a project in the Desktop App or CLI. That inventory file determines which repositories get managed.
A regular git clone will not enter the project into the inventory so AI Workbench won’t see it.
- The managed Git features are there for convenience - You can also use Git natively.
The Desktop App “easy buttons” are for relatively simple versioning tasks. It’s not full Git control.
When that’s inconvenient, use Git in the terminal or a Git client.
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 - Know when to move to native Git.
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.
- Start in the terminal, finish in the terminal - Managed Git works poorly with intermediate states.
Switching between the terminal and the Desktop App midstream can cause unexpected behavior or errors in AI Workbench.
For example, starting a rebase in the terminal but trying to resolve conflicts in the Desktop App will raise errors and may trigger undesired merge resolutions.
Another example is staging files in the terminal but committing changes in the Desktop App. The Change screen in the project tab just sees changes, and committing selected changes will ignore whatever you have staged in the terminal.
- 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.