Accessing a Git repository
Configure access to a Git repository that is associated with your project to enable collaboration, manage file versioning, and enhance branching and file merging.
If you are using a Git server, you will need to allow network traffic between the compute nodes on your Watson Studio cluster and your Git server. Check with your Git server provider to learn the specific ports that are used by your Git server.
Requirements
Before you begin, consider the following:
- Don't use the same Git repository in projects with default Git integration and in projects with deprecated Git integration.
- Bitbucket Enterprise only: You must enter the URL to your repository in the following format:
https://<repo-url>.git
. Don't include your user name in the URL. - Repository restrictions in projects with deprecated Git integration:
- For an empty project:
- The repository doesn't have to be empty, however, it can't contain an exported project. All files in the repository will be deleted during project creation.
- If the repository is locked by another project, you can reassign the repository to your new project by deleting the
.project-lock.json
file. The other project loses access to the repository.
- For a project created from Git:
- The repository must contain exported assets from a Cloud Pak for Data project.
- The repository can be locked by another project. To enable synchronization between the project and the repository, you must delete the
.project-lock.json
file in the repository. The other project loses access to the repository.
- For an empty project:
Configuring access
To get access to a Git repository when creating a project:
-
Select an existing access token or create a new one. To create a token:
-
Click New Token.
-
Select the platform you want to create a personal access token for. The following Git servers are supported:
- GitHub
- GitHub Enterprise
- GitLab
- GitLab Self-Managed
- Bitbucket
- Bitbucket Enterprise
- Azure DevOps Services
-
Log in to the platform and follow the instructions to generate a new token with repo scope. Restrictions and considerations:
- The token must have read and write access to the repository.
- If the Git repository is hosted on Azure, the token must have full access.
- For Bitbucket Enterprise, you must have Repository admin rights to create a token.
- Tokens to Git repositories are managed at the user level, not at the project level. This means that every user must create their own token.
- Tokens in deprecated Git projects cannot be updated if they've expired. Tokens must be valid for the life of the project.
-
Copy the newly generated access token and paste it in the Git integration dialog window.
-
Optional for GitHub Enterprise, GitLab Self-Managed, and Bitbucket Enterprise if you need to provide a self-signed certificate or override an existing certificate: Paste the certificate details that you got from your Git administrator in the Git integration dialog window.
These details must be in PEM format.
-
For GitHub Enterprise, GitLab Self-Managed, and Bitbucket Enterprise only: Enter the domain name and your user name.
The domain name URL must use the
https
protocol used at the time the access token is created and is not allowed to end with a forward slash (/
). An example is:https://dse-bitbucket.mylab.mycompany:8443
. Note that existing Git Enterprise tokens that don't use thehttps
protocol, will not work. You must create new ones that use a correct domain name URL. -
Give the generated token a name.
-
-
Select this token on the create project page.
-
Enter the URL to a repository in the platform you selected. For example, to a repository in GitHub, enter
https://github.com/myName/projectrepo.git
. -
After the repository is validated, select a branch. This branch is the main branch for your overall Git workflow. Note that only the first 30 branches in the repository are listed for selection.
-
Give all the users that you want to collaborate with on files in JupyterLab or RStudio read/write access to the Git repository.
Enterprise-grade Git instance certificates
The enterprise-grade instances of Git that you can associate with a project in Watson Studio, namely GitHub Enterprise, GitLab Self-Managed and Bitbucket Enterprise, mostly use a publicly trusted CA-signed certificate for secure Git client traffic. This CA-signed certificate is automatically taken to authenticate to the platform at the time the platform access token is created and does not have to be provided during project creation. Sometimes however, a Git enterprise-grade platform might use a self-signed certicate for authentication. If a self-signed certificate is used, you need to provide the certificate details at the time you create the platform access token. Ask your Git administrator for those details.
You can override a certificate by creating a new platform access token and providing the new certificate details if:
-
You need to move from a CA certificate to a self-signed certificate
All new projects will start using the new certificate. To use the Git platform in existing projects, you need to contact IBM Support.
-
You need to update a self-signed certificate or it expires and becomes invalid
All new and existing projects will start using the new certificate.
-
You need to move from a self-signed certificate to a CA certificate
All new and existing projects will start using the new certificate. This is the only time you need to provide the CA certificate details.
Parent topic: Creating a project