Manage Git repositories as workspace resources
The procedures below explain how to manage Git repositories used as Python libraries on workspace level (in workspace resources)
Purpose and benefits
Add a Git repository to your workspace resources if you want to use it as a Python library with a setup.py file in it. Once added to the selected workspace, this repository can be installed into any notebook residing in that workspace. It has the following benefits:
You set up, store, and manage Git repositories on workspace level.
You can attach Git repositories to any notebook from the workspace where these repositories reside.
When setting up a Git repository, you use SSH keys stored in the same workspace.
This approach ensures SSH keys security as they are never accessible on the agent.
Add a Git repository to a workspace
The procedure explains how to add a Git repository to a workspace from the Home page.
On the Home page, select the workspace to which you want to add the repository.
From the left-hand side menu, select Other and switch to the Repositories tab. This will open the list of Git repositories in the selected workspace.
On the Repositories tab, click the Add button in the upper right corner.
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.
Now that the new Git repository connection is added, you can attach it to notebooks.
Manage workspace Git repositories
On the Home page, select the workspace to which you want to add the repository.
From the left-hand side menu, select Data and switch to the Repositories tab. This will open the list of Git repositories in the selected workspace.
In the Repositories view, right-click the repository you want to manage.
Use the following options available in the popup menu:
Edit: to change the display name, URL, SSH key, or default reference of the repository.
Rename: to change the display name of the repository.
Clone: to close the repository to the same workspace. It will be added to the same list under a slightly different name.
Clone to other workspaces: to clone the repository to other workspaces. You will be prompted to select where to clone the repository.