Publishing notebooks on GitHub
To support collaboration with stakeholders and the data science community at large, you can publish your notebooks in GitHub repositories. You can also use this integration feature as a method to backup notebooks for source code management purposes.
Watch this video to see how to enable GitHub integration.
Enable access to GitHub from your account
Before you can publish notebooks on GitHub, you must enable your Watson Studio app to access GitHub. You enable access by creating a personal access token with the required access scope in GitHub and linking the token to your Watson Studio app.
Follow these steps to create a personal access token:
- Navigate to your Watson Studio account settings, and click the Integrations tab.
- Click the GitHub personal access tokens link on the dialog and generate a new token.
- On the New personal access token page, select repo scope and then click to generate a token.
- Copy the generated access token and paste it in the GitHub integration dialog window in Watson Studio.
Link a project to a GitHub repository
After you have saved the access token, your project in Watson Studio must be connected to an existing GitHub repository. You can only link to one existing GitHub repository from a project in Watson Studio. Private repositories are supported.
To link a Watson Studio project to an existing GitHub repository, you must have administrator permission to the project. All project collaborators, who have adminstrator or editor permission, can publish files to this GitHub repository. However, these users must have permission to access the repository. Granting user permissions to repositories must be done in GitHub.
To connect a project to an existing GitHub repository:
- Go to the project’s Settings page.
- Enter the browser URL of the GitHub repository in the GitHub Respository section.
Now you can begin publishing notebooks on GitHub.
Publish a notebook on Github
To publish a notebook, you can:
- Select the notebook in the Notebooks list on the project’s Assets page and click Actions > Publish on GitHub.
- Click the GitHub integration icon () and select Publish on GitHub from the opened notebook’s action bar. The notebook must be opened in edit mode.
When you enter the name of the file you want to publish on GitHub, you can specify a folder path in the GitHub repository.