Git operations

The SnapLogic® Git Integration supports the main Git commands for checking out a repository, adding assets to be tracked, and committing changes. Checking out the repository associates it with a project space and all projects in that space, or with a single project.

Depending on your workflow, you can associate a repository and then add the SnapLogic assets to be tracked by Git. Or, you can populate a SnapLogic project space or project from an existing repository that contains SnapLogic assets. Refer to Track project assets in a Git repository and Concurrent development for descriptions of the workflow.

The remainder of this page describes:

Project space and project level repositories

In the SnapLogic Manager, a project space can contain assets at the root level and multiple projects. To track root assets and multiple projects in the same Git repository, check out at the project space level. To have a repository for each project, check out at the project level instead. SnapLogic supports the same Git operations for both types. The repository structure in the Git provider and the menu for Git operations in the SnapLogic UI differ depending on whether a repository is associated with a project space or with a project.

When you associate a repository with a project space, SnapLogic adds the child projects to the Git repository structure as folders. Project Space root assets, those not under a project, go into a logical folder named root. Git tracks files, not folders. The folder for the root assets indicates that these assets are available to all projects and are not associated with any single project.

Note: If the repository already contains a folder named root (case-sensitive), assets at the project space root level will be put into a new folder named root(1).

In the SnapLogic UI, Git operations are available from the project space menu, the project menu, and from the Manager asset toolbar. The following table shows where to access the available operations depending on whether the check out was for a project space or for a project:

Check out level Available Git operations
From the project space menu From the project menu
Project Space
  • None
Project

After you check out a Git repository at the project space level, you can perform the Git operations from the project space menu or from the Manager asset toolbar:

Project space menu - Left navigation tree Project Asset Toolbar
After check out, Git operations in the left navigation tree are available only on the project space context menu but not on the individual projects. After checkout, Git operations in the Project Asset toolbar are available only on the project space context menu but not until the check out.

Git operations

The following table lists the Git operations available in SnapLogic Manager and from public APIs

Tip: You can also use the Git command line interface or the Git hosting provider's UI to add, remove, and commit file assets. However, before resuming work on a project, pull from the repository to get the latest updates into SnapLogic.
Operation Using SnapLogic Manager Using SnapLogic Public APIs
Create a project Create a project from a repository Create project from Git files
Create a new branch and associate it with a project space or project Create a branch Create a Git branch
Create a new tag Add a tag Add a Git tag
Check out a branch or tag Check out a branch or tag Check out project files from Git
Switch branches Switch branches N/A
Add a single asset to be tracked Add a single asset N/A
Commit all updated assets Commit updates N/A
Remove assets from being tracked Remove assets N/A
Pull updates from a repository Pull from the repository Pull the latest project files from Git
Untrack project with Git Untrack project space or project Untrack project with Git

Asset status

The manager asset table shows which assets are tracked in a Git repository and their status. The following example shows the Test project space associated with a Git repository. The All tab of the assets table lists a root folder that contains all assets from the root of the project space. Projects are listed as directories. Because no assets from those projects have been added to Git yet, their status is untracked.


Table of assets

The banner above the asset table includes:
  • The repository and branch or tag that tracks the project space
  • The commit SHA

The Git Status column shows the status of assets. The assets table shows project folder status for project space checkouts. It also shows the status of individual assets. A project can have a mix where some assets are tracked and some are not.

Status Project folder Individual asset
Added One or more project assets are staged to be added to the Git repository. Tracking assets in Git is a two-step process, after adding them, you must commit them. The asset is staged to add to Git. Commit to start tracking the asset with Git.
Removed One or more project assets are staged to be removed from the Git repository. Commit to stop tracking them. The asset is staged to remove Git. Commit to stop tracking the asset with Git.
Tracked Git has a history of one or more assets in the project. The state of the assets in the Git repository are the same as those in the SnapLogic environment. The asset in the Git repository is the same as the asset in the SnapLogic environment.
Tracked, Modified Locally One or more project assets in the local SnapLogic environment were modified but the changes have not been committed to the Git repository. The asset was modified locally but has not been committed to the Git respository.
Tracked, Modified Remotely One or more project assets in the Git repository were modified, but those changes have not been pulled to the local SnapLogic environment. The asset was modified in the Git repository but has not been pulled to the local environment.
Tracked, Conflict Project assets were modified locally and in the Git repository, and the changes conflict with each other. Pull from the repository and resolve the conflict. The asset was changed locally and changed in the Git repository. Pull from the repository and resolve the conflict.
Untracked Git doesn't have a history of any assets in this project. Git is not tracking this asset.