Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

On this Page

Table of Contents
maxLevel2
excludeOlder Versions|Additional Resources|Related Links|Related Information

...

After you have authorized SnapLogic to access GitHub on your behalf, Git operations will be available in SnapLogic Manager. Your next steps depend upon whether your Project is already associated with a GitHub repository:

Organizations often use multiple SnapLogic Orgs for development, testing, and deployment. By using the Git Integration, you can work on the same Project in different Orgs and track changes in the same repo. For example, in a development Org, you might associate Project1 with a dev branch of Project-Repo-1. When you are ready to move the Assets to the testing Org, check them in and merge to the test branch in GitHub. In the test Org, create Project1 associate it with Project-Repo-1 and checkout the test branch.

The Project can have a maximum of 200 files. If checking out a Project with more than 200 files, SnapLogic throws an error.

Warning

When committing files to GitHub from SnapLogic, some subdirectories might be inadvertently deleted from the repository, including GitHub Actions workflows in the .github directory. Target fix version: 4.29.

...

2 patch in

...

SnapLogic → GitHub

You can perform the following operations on files in the GitHub repository through SnapLogic:

  • Add files
  • Update files
  • Delete files

...

July 2022

Anchor
linking
linking
Linking a Repository to a Project

After a Project is associated with a repository, you can add, update, or delete files from SnapLogic or from GitHub. To link a repository to a Project, follow these steps:

  1. In the SnapLogic Manager, navigate to your Project and click the arrow:

    Image Added
  2. In the options menu, click Checkout GitHub Repository:

    Image Added
  3. Select the repository and branch or tag to link the project:

    Image Added
  4. Click Checkout.

The Git Integration associates the Project with the branch of the repository. You must add the Assets to track and they will display in the Project Asset table. The table title includes tracking information and a column for GitHub Status:

...

Switching Branches

To switch Project Assets to a different branch, follow these steps:

  1. In the SnapLogic Manager, navigate to your Project and click the arrow:

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

    Image Added
  3. In the Checkout GitHub Repository dialog, select the branch to switch to:

  4. Click Checkout.

The Assets in the Project now reflect the state of the Assets committed to that branch.

Anchor
working
working
Working with Tracked Assets in Manager

From SnapLogic Manager, you can perform the following Git operations on Project Assets:

Anchor
add
add
Add Assets to the Repository

Adding a Project Asset to the repository and committing it results in it being tracked by GitHub. You can add untracked Assets of all types, except Snap Pack and Snaplex. The procedure for all supported types is similar to the example documented here for adding a file, but you would not be uploading them, you would instead be creating them in the SnapLogic IIP. A

Tip

An alternate way to add an Asset is to commit Project changes. The Commit Changes dialog displays Assets that were not previously added in an Untracked assets list. Select the corresponding checkbox for an Asset and click Commit. After the commit, the GitHub status for that Asset changes to Tracked.

To add a file, follow these steps:

  1. Navigate to the project in SnapLogic Manager.

...

  1. Image Added
  2. Click (blue star) and upload the file

...

  1. .
    The file displays in the

...

  1. Asset table with the GitHub Status 

...

  1. Untracked

...

  1. Image Added
  2. Open the File options menu by clicking the

...

  1. arrow

...

  1. to

...

  1. the right of the file name: 

...

  1. Image Added

...

  1. Click Add to Repository. The GitHub status changes

...

  1. to Added.

...

  1. Image Added
  2. With the file selected, open the GitHub menu and click Commit to GitHub Repository. The Commit changes dialog box opens. The file is shown under Changes to

...

  1. Commit in the dialog box.

  2. Add

...

  1. Commit Message. 

...

  1. Image Added

...

  1. Click Commit. The file is added to

...

  1. the Asset table and the GitHub Status

...

  1. reads Tracked

...

  1. Image Added
  2. Refresh the GitHub page. The new file is displayed in the

...

  1. repository along with the commit message.

    Image Added

Anchor

...

update

Note

If you omit step #3 and commit changes to the repository:

  • The GitHub Status reads Untracked asset in the Asset table.
  • The file is shown under Untracked assets in the dialog box in the Commit Changes dialog box. Select the corresponding checkbox for this asset and click Commit to commit it to the repository. GitHub status changes to Tracked.

update
Updating Assets in the GitHub Repository

Using the typical Git workflow, you can update one or many Assets in a single commit. The following steps show an example of updating a single file. For other Assets, such as Pipelines and Tasks, edit them as usual and commit from the Project options menu.

To update a File Asset, follow these steps:

  1. Navigate to the project in SnapLogic Manager.

...

  1. Image Added
  2. Upload

...

  1. a file from

...

  1. local storage (by clicking

...

  1. the +

...

  1.  symbol, and uploading it). Since the file already exists

...

  1. , an Asset conflict error dialog box displays. Click Overwrite to confirm.

    Image Added
  2. Go to the GitHub menu and

...

  1. click Commit to GitHub. The Commit Changes dialog box opens. It automatically detects if there is a newer version of a file and lists it out in the dialog box under

...

  1. the Changes to Commit list.

...

  1. Image Added
  2. Add

...

  1. Commit Message, if required.

...

  1. Click Commit. The Asset table is updated.

...

  1. Image Added
  2. Refresh

...

  1. the GitHub repository page to confirm the update

...

  1. Image Added

Anchor
delete
delete
Deleting Assets from the GitHub Repository

You can delete any type of supported Asset from the repository. This does not delete the Asset, but it is no longer tracked by GitHub. The following provides an example of deleting a file.

To delete a file from the repository, follow these steps:

  1. Navigate to the project in SnapLogic Manager.

...

  1. Image Added

  2. Open the File options menu by clicking the

...

  1. arrow adjacent to the

...

  1. right of the file name.

  2. Click Remove from Repository. The GitHub Status changes to Removed

...

  1. :

  2. Commit

...

  1. the deletion from the GitHub menu

...

  1. by clicking Commit to GitHub Repository.

...

  1.  

  2. Add

...

  1. Commit Message, if required

...

  1. :

...

  1. Image Added

...

  1. Click Commit. The GitHub Status changes to Untracked and the file is deleted from the GitHub repository. 

...

  1. Image Added
  2. Refresh

...

  1. the GitHub repository page to confirm deletion

...

  1. Image Added

Anchor
working_github
working_github
Working with Assets in GitHub

You can also perform the following operations on

...

Project Assets using the Git command line or GitHub repository page:

  • Add files

  • Update files

  • Delete files

Add Assets/Files to the Project

...

Update Assets/Files in the Project

...

Delete Assets/Files from the Project 

...

Conflict Resolution in Pull Requests

It may happen that you have updated an asset in SnapLogic and also updated the same file in your GitHub repository. This causes a conflict when you perform a pull operation. In such scenarios, SnapLogic lets you specify whether you want to overwrite. 

 Image Removed

To overwrite your local file with the repository version, select the file and click Pull. Click OK in the confirmation message displayed.

Image Removed

...

If you make any changes from the GitHub side, you need to pull them in SnapLogic to synchronize the Project.

Pulling Updates with No Conflicts

The following example shows what happens when you initiate GitHub Pull in Manager after a file was committed to the GitHub repository:

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

    Image Added

  2. If you click OK  the new Asset displays in the Asset table:

    Image Added

Pulling Updates with Conflicts

If an Asset was changed in GitHub and a change was made in Manager since the last commit, a pull operation creates a conflict. The Pull Messages dialog allows you to resolve the conflict:

...

Resolve the conflict in one of the following ways:

  • To overwrite a local file with the repository version, select the file and click Pull.

  • To retain the local file, do not select the checkbox and click Pull. To overwrite the version in the GitHub repository

...

  • with the local file, commit it.

...

See Also

...