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.

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 July 2022

SnapLogic → GitHub

...

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 files in the GitHub repository through SnapLogicProject Assets:

  • Add files

  • Update files

  • Delete files

...

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.

    Image RemovedUpload Image Added
  2. Click (blue star) and upload the file by clicking the + symbol.
    The file displays in the Asset table ; but with the GitHub Status reads Status Untracked

    Image RemovedImage Added
  3. Open the File options menu by clicking the downward arrow adjacent to this file in the Asset table.the right of the file name: 

    Image RemovedImage Added
  4. Click Add to Repository. The GitHub status changes to Added.

    Image RemovedGo to Image Added
  5. 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 Commit in the dialog box.

  6. Add a Commit Message. 

    Image RemovedImage Added
  7. Click Commit. The file is added to the Asset table and the GitHub Status reads Tracked

    Image RemovedImage Added
  8. Refresh the GitHub page. The new file is displayed in the 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.

    Image RemovedImage Added
  2. Upload the asset a file from your local storage (by clicking the + symbol, and uploading it). Since the file already exists in your repository (and in your Asset table), an "Overwrite" dialog box is displayed, an Asset conflict error dialog box displays. Click Overwrite to confirm.

    Image RemovedImage Added
  3. Go to the GitHub menu and 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 the Changes to Commit list.

    Image RemovedImage Added
  4. Add a Commit Message, if required.

  5. Click Commit. The Asset table is updated.

    Image RemovedImage Added
  6. Refresh your the GitHub repository page to confirm the update

    Image Removed

...

  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.

    Image Removed Image Added

  2. Open the File options menu by clicking the downward arrow adjacent to the right of the file to be deletedname.

  3. Click Remove from Repository. The GitHub Status changes to Removed.
    Image Removed:

  4. Commit changes by going to the deletion from the GitHub menu and by clicking Commit to GitHub Repository. The Commit Changes dialog box opens.  

  5. Add a Commit Message, if required.:

    Image RemovedImage Added
  6. Click Commit. The GitHub Status changes to Untracked and the file is deleted from the GitHub repository. 

    Image RemovedImage Added
  7. Refresh your the GitHub repository page to confirm deletion

    Image Removed

...

  1. Image Added

Anchor
working_github
working_github
Working with Assets in GitHub

You can also perform the following operations on assets in a SnapLogic project through GitHubProject Assets using the Git command line or GitHub repository page:

  • Add files

  • Update files

  • Delete files

Add Assets/Files to the Project

...

Commit changes by clicking Commit. The new file is displayed in your repository.

...

In the GitHub menu click GitHub Pull. The GitHub Pull dialog box opens, displaying the files that were added in the Asset list.|

...

Click OK to close the dialog box. The file is added to the Asset table.

...

Update Assets/Files in the Project

...

Add a commit message and commit changes by clicking Commit. The updated file is displayed in the repository.

...

In GitHub menu options click GitHub Pull. The GitHub Pull dialog box opens, displaying the files that were updated in the Asset list.

...

Click OK to close the dialog box. The file is updated in the Asset table.

...

Delete Assets/Files from the Project 

...

Add a commit message and commit changes by clicking Commit. The file is deleted from the repository.

...

Click OK to close the dialog box. The file is deleted from the Asset table.

...

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 operationIn 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.

...

If you do not want to overwrite the local file with the version in the GitHub repository, do not select the checkbox in the GitHub Pull dialog box. Click 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