Manage Git repositories in notebook environment
This is the easiest way to install a publicly available Git repository from the user interface into a single Datalore notebook.
Open the notebook and click the Environment icon on the left-hand sidebar of the editor.
Switch to the Repositories tab.
Click the Select repository to attach to expand the list of workspace repositories.
Select a repository from the expanded list.
In the Select reference popup window, do one of the following:
Click the Apply button to use the default reference set on the workspace level.
Select the other radio button to override the default reference, select a branch, and click the Apply button.
After the repository is attached, click restart kernel in the notification popup to complete the environment update.
If you want to access a private Git repository with a personal token or via credentials, use the init.sh script.
The procedure adds a Git repository to the environment of the selected notebook as a Python library and also adds it to the resources of the respective workspace, which makes it available for any other notebook residing there.
Open the notebook and click the Environment icon on the left-hand sidebar of the editor.
Switch to the Repositories tab.
Click the Add connection button.
In the Add repository connection dialog, do the following:
In the Display name field, provide a name under which the repository will be listed in the workspace.
Provide the URL of the repository in the respective field.
(Optional) To provide an SSH key, expand the list under SSH key and select one of the keys available in this workspace. For more details, see Manage SSH keys.
For Default reference, select the repository branch you want to reference. To use a branch other than the default one, click Fetch the list of available repository references, expand the Default reference list, and select a branch.
Click the Test connection button.
Once the connection is successfully tested, click the Create and close button.
In the notebook, open the Environment tool from the left-hand sidebar.
Switch to Repositories.
In the repository list, right-click the item you want to manage.
Use the following options available in the popup menu:
Update repository: to update the attached repository.
Change reference: to change the repository reference. You can select the default reference set on the workspace level or any other repository branch.
Edit: to change the display name, URL, SSH key, or default reference of the repository.
Show installation log: to view or copy the log of the repository installation.
Detach connection: to detach the repository connection from the notebook. The repository connection will remain available as a workspace resource.
Thanks for your feedback!