Pull from Git

This functionality is provided for pulled Notebooks. The users need to start with initial Pull from the Git repository to proceed with this functionality.

Pulling from Git

Pre-requisite:

  • The user needs to do the Admin configuration with an authentication token.

  • The user also needs to do Project level- configuration of Git Project and Git branch.

Please Note: the user can generate an authentication token from their Git Lab or Git Hub repositories.

Admin Level Configuration

Check out the given illustration to understand the Admin configuration part with the authentication token under the platform.

Pull Pre-requisite
  • Navigate to the Admin module.

  • Open the Version Control from the Configuration options.

  • Select the Token type as a private token.

  • Provide the authentication token in the given space.

  • Click the Test option.

  • A notification message appears to inform the user that authentication has been established.

  • Click the Save option.

  • A notification message appears to inform that the version control has been updated.

Pulling Git file in Notebook

Projects and Branches created in GitLab/GitHub can be accessed using the access token inside the DS Lab and the files (.ipynb) can be pulled using the Pull from Git functionality.

Once the initial pull (import) has happened, the user can pull the latest version of the Python file from Git using the Pull from VCS functionality available in the Notebook List.

Please Note: Only .ipynb files will be supported.

Pulling from Git
  • Navigate to an activated Project.

  • Open the Notebook tab (It opens by default).

  • Click the Import option.

  • The Import Notebook page opens.

  • Select the Pull from Git option.

  • All the available versions appear.

  • Click the Save option.

  • A notification message appears to ensure that the selected file is pulled.

  • Consecutive notification message appear to ensure that the Notebook is started, imported, and saved.

  • Access the Notebook script from the Git repository.

  • Open the same script from Git.

  • Click the Edit option.

  • The script opens in Edit file mode.

  • Modify the script.

  • Click the Commit Changes option.

  • A notification message appears to ensure that the changes are successfully committed.

  • The modification committed in the script gets saved.

  • Navigate to the same Notebook.

  • Click the ellipsis icon to get the Notebook options.

  • Click the Pull from VCS option.

  • The Pull from Git dialog box opens.

  • Click the Yes option.

  • A notification message appears to inform the user that the latest file version is pulled.

  • Another notification message appears to inform the user that the pulled Notebook is started.

  • The latest/ modified script gets updated.

Pushing to Git

Push pre-requisites:

  1. The user branch should have Developers' + maintainers' permission to push the latest code into the Main branch.

  2. The User token has to be set in the user profile using the Custom Fields setting available at the Admin level.

  3. The user token key name has to be 'bdbvcstoken'.

Pre-requisites for Pushing a file to Git
  • Navigate to the Admin module.

  • Open the Custom Field Settings under the Configurations option.

  • The Custom Field Information appears.

  • Provide the following information for custom field:

    • Key- bdbvcstoken

    • Input type - Manual

    • Description - Git User Token

    • Mandatory - No

  • Click the Save option to save the modified Custom Field Settings.

  • A notification message appears to inform the user that the custom field settings are updated.

  • Navigate to the Security module.

  • Go to the Users list.

  • Select the user from the list.

  • Click the Edit icon.

  • The Update User page opens.

  • Check out the Custom Fields section.

  • Validate whether the Git User Token is valid or not. If not provide the valid Git User Token.

  • Click the Save option.

  • A notification message appears to inform that the user is updated successfully.

  • Open the User Profile.

  • Select the My Account option.

  • The My Account details get displayed.

  • Open the Configuration option.

  • The same token gets updated under the Git Token section which was provided under the Configuration section.

Pushing a File to Git

Please Note: Before using the Push a file to Git functionality make sure that the following requirements are fulfilled:

  1. The latest file is pulled into DS Lab before modifying and pushing back to the Git branch.

  2. The user should have access to the Git branch for pushing a change.

Pushing to Git
  • Open an activated Project.

  • Navigate to the Notebook tab (it opens by default).

  • Select a Notebook from the displayed list to open the content/script.

  • The existing content gets displayed. Carefully notice the script version.

  • Click the ellipsis icon to get the notebook options.

  • Click the Push into VCS option for the selected Notebook.

  • The Push into Git dialog box opens.

  • Provide a commit message.

  • Click the Push option.

  • A notification message appears to ensure that the latest file version is pushed (to Git).

  • Navigate to the Git repository and access the pushed version of the Notebook script.

  • Open the script.

  • Click the Edit option.

  • The file opens in Edit mode.

  • Modify the script. E.g., In the given image the version number is changed from V1 to V2.

  • Click the Commit changes option.

  • A message appears to ensure that your changes have been successfully committed.

  • Navigate back to the same Notebook.

  • Verify the script content. E.g., the image displays that the selected Notebook has an older version mentioned.

  • Click the ellipsis icon to get the Notebook options.

  • Click the Push into VCS option.

  • The Push into Git dialog box appears.

  • Provide a Commit Message.

  • Click the Push option.

  • An error message appears suggesting the users take the latest pull since the currently existing file does not contain the latest update.

  • Click the ellipse icon for the same Notebook.

  • Click the Pull from VCS option from the displayed menu

  • The Pull from Git dialog box opens.

  • Click the Yes option to pull the latest file version from Git.

  • A notification message appears to notify that the latest file version has been pulled.

  • Navigate to the same Notebook.

  • Check out the Notebook script, the latest modifications will be reflected in the script. E.g., In this case, the updated version appears in the script.

  • Modify the available script inside the Notebook. E.g., Again the Version of the script has been changed to V3.

  • Click the Save icon to save the changes.

  • A notification message appears to ensure that the Notebook has been successfully saved.

  • Click the ellipsis icon to open the Notebook options.

  • Click the Push into VCS option from the displayed list of options.

  • The Push into Git dialog box opens.

  • Provide a commit message.

  • Click the Push option.

  • A success notification message appears ensuring that the latest file version has been pushed to Git.

Please Note: The Pull from Git functionality supports Git Lab and Git Hub.

Last updated