Skip to end of banner
Go to start of banner

Performing GitHub Operations

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 31 Next »

After authorizing SnapLogic to access GitHub, you can start tracking a Project’s Assets, with the exception of Snap Packs and Snaplexes, in a GitHub repository. The repository must exist in GitHub first. From SnapLogic Manager, check out a branch or a tag per Project. Create and modify Accounts, Pipelines, Files, and Tasks in your normal workflow. From Manager, add, commit, and remove Assets from the GitHub repository. You can also add, commit, and remove file Assets using a command line or the GitHub UI.

We recommend using different SnapLogic Orgs to manage Assets during development, testing, and deployment. Using the Git Integration, you can work on the same Project in different Orgs and track it in the same GitHub repository. For example, in a development Org, you might associate Project-1 with a dev branch. When the Assets are ready for testing, commit and merge them to the test branch. When testing and bug fixing is complete, merge the changes into the main branch and tag a release for the production Org.

Refer to the Git Integration overview page for limitations and prerequisites.

The following sections describe how to track Project Assets in GitHub:

Associating Project Assets with a Repository

Use Manager to check out a GitHub repository for tracking Project Assets. If a repository for a Project does not exist, you must first create it in your GitHub organization.

Checking out a Branch or a Tag

Check out a respository branch or tag:

  1. In the navigation tree, find the Project and click the arrow to open the options menu:

  2. From the options menu, choose Checkout GitHub Repository:

    Project options menu
  3. From the dropdown menus, select the repository:

  4. In the Branches/Tags field:

    • To select an existing branch or tag, click the arrow to display the list.

    • To filter the list start entering a name.

  5. Click Checkout.

The Git Integration associates the Project with the branch or tag. The banner above the Assets table identifies which repository and branch or tag is tracking the Project. The GitHub Status column shows whether assets are Tracked, Untracked, or Added:

Creating a New Branch

Create a new branch from the branch that is already checked out for a Project. For example, to create a new branch from the main branch, first check out main.

To create the new branch:

  1. In the navigation tree, click the arrow to open the options menu:

  2. From the options menu, choose Checkout GitHub Repository:

    Project options menu
  3. Verify that the repository and a branch are selected.

  4. In the Branches/Tags field, enter a new name:

  5. Click Checkout.

Switching Branches

To switch to a different branch, follow these steps in Manager:

  1. In the Project navigation tree, click the arrow next to the Project name:

  2. From the options menu, click Checkout GitHub Repository:

  3. In the Checkout GitHub Repository dialog, select the branch or tag to switch to. Enter a name to filter or to create a new branch from the existing branch.

  4. Click Checkout.

Project Assets update to the state last committed to that branch or tag.

Adding a Single Asset

Assets that are not part of the repository have a GitHub Status of Untracked. You can add Assets individually or commit changes to add multilpe Assets at one time. Individually added Assets are not visible in GitHub until you commit them.

To add a single Asset to the repository in Manager:

  1. In the navigation tree, select the Project to display the Assets table.

  2. Find the Asset to add.

  3. Open the options menu by clicking the arrow to the right of the Asset name.

  4. Select Add to Repository:

    Add to repository

    The GitHub Status changes to Added.

Committing all Updated Assets

Update one or many Assets in a single commit. When you commit Project changes, you can select which updated Assets to commit. To commit changes:

  1. In the navigation tree, click the arrow to the right of the Project name to open the options menu.

  2. Select Commit to GitHub:

    Commit to GitHub

    The Commit Changes dialog box opens and lists the Assets to commit:

    Commit changes dialog
  3. Deselect any Assets that you do not want to commit.

  4. Add a Commit Message.

  5. Click Commit. The Asset table updates with the new GitHub Status.

  6. Log in to your GitHub account to confirm the commit.

Removing Assets

You can delete any type of supported Asset from the GitHub repository. This does not delete the Asset in Manager, but stops GitHub from tracking it. Similar to the add operation, you must commit Project changes before the Asset is removed from the repository.

To remove an Asset from the repository, follow these steps:

  1. In the navigation tree, select the Project to display the Assets table.

  2. Find the Asset to remove.

  3. Open the options menu by clicking the arrow to the right of the Asset name.

  4. Click Remove from Repository.

    Remove from repository

    The GitHub Status changes to Removed:

Pulling from a Repository

You can add, delete, or commit file Assets using the Git command line or the GitHub UI. If you or a colleague makes any changes to the GitHub repository, you need to pull the changes into SnapLogic to synchronize the changes.

Pulling Updates with No Conflicts

The following example shows what happens when pulling from GitHub after nonconflicting changes were committed to the GitHub repository:

  1. In the navigation tree, click the arrow to the right of the Project name to open the options menu.

  2. Select GitHub Pull.

  3. The GitHub Pull Messages dialog lists the Assets that were fetched from GitHub.

  4. Click OK to update the Assets with the changes from GitHub.

Pulling Updates with Conflicts

If an Asset was changed in both GitHub and the IIP since the last commit, pulling from GitHub creates a conflict. The Pull Messages dialog allows you to resolve the conflict:

Resolve the conflict in one of the following ways:

  • To overwrite the local file, select it and click Pull.

  • To retain the local file, do not select the checkbox and click Pull, then commit the Project.

Related Content

  • No labels