Skip to main content

Use JupyterLab's GitLab Extension

If enabled for your account, you can use JupyterLab's GitLab extension to provide version control for your code in JupyterLab. To request the GitLab extension, create a Safe Haven case in the LiveRamp Community portal.

Note

Jupyter Notebook does not support the GitLab extension.

The following instructions provide examples of how to use the GitLab extension and assume that you have experience using the Git source control system for tracking file changes. For more information about Git, see the "git" website.

Procedure. To use the GitLab extension in JupyterLab:
  1. Open the Analytics Environment virtual machine desktop and sign in using two-factor authentication.

  2. From the virtual machine desktop landing page, click the appropriate JupyterLab tile.

    LSH_AE-Open_Jupyter_Notebook-tile.jpg

    Tip

    If your account has access to more than one tenant, choose the tile for the desired tenant account.

    JupyterLab shows the following repositories:

    • personal-repository: Only you have permission to view code that you write to this folder.

    • shared-repository: If you write your code to this tenant-level folder, all the users in this tenant can view your code.

    JupyterLab_URL-Repository_Folders.png

    Caution

    The following default branches of the shared-repository are protected, so you cannot push code directly to them:

    • main

    • origin/head

    • origin/main

    You can create branches of the shared-repository, commit code to them, and use them to share code with other users.

  3. Click and open the shared-repository and then click the GitLab extension icon GitLab-Extension-Icon.png.

    JupyterLab-GitLab-shared-repository.png
  4. To pull the latest changes from GitLab, click the download icon.

    JupyterLab-GitLab-Pull.png
  5. To share files in the shared-repository, create a branch because its main branch is protected. You cannot push code directly to its main branch.

    JupyterLab-GitLab-Branch.png
    1. Click Manage branches and tags.

      JupyterLab-GitLab-Manage_Branches.png
    2. On the Branches tab, click New Branch.

    3. Enter a name for the branch and then click Create Branch.

      You and other users can now share code to the shared-repository.

  6. Click the Changes tab to add files to be tracked.

    JupyterLab-GitLab-Changes_Tab-Track_File.png

    Tip

    Do not track files that end with _checkpoints because JupyterLab generates these automatically when it saves files.

  7. To commit the tracked files, enter a description and click COMMIT. Enter your user name and email if needed.

    JupyterLab-GitLab-Commit.png
  8. To view any differences between what you have changed and what is in GitLab, click the Diff icon.

    JupyterLab-GitLab-Diff.png
  9. To push your changes to GitLab, click the upload icon.

    JupyterLab-GitLab-Push.png
  10. To track changes to your files, click the History tab and view who changed what file when.

    JupyterLab-GitLab-History_Tab.png
  11. For another user to pull any changes that you want to share with them, they need to click the download icon GitLab-Pull-Icon.png.