Git Credentials
Connecting GitHub.com to your local
You can access and write data to repositories on GitHub.com using SSH (Secure Shell Protocol) or HTTPS (Hypertext Transfer Protocol Secure).
Using git integration
1.Connecting using SSH
Generating a new SSH key
You can access and write data in repositories on GitHub.com using SSH (Secure Shell Protocol). When you connect via SSH, you authenticate using a private key file on your local machine. After generating the key, you can add the key to your account on GitHub.com to enable authentication for Git operations over SSH.
Steps to follow to create SSH key:
- Open Git Bash.
- Paste the text below, substituting in your GitHub email address.This example using ed25519 as the key name.
$ ssh-keygen -t ed25519 -C "your_email@example.com"
- Your keys will then be created in the .ssh directory, the created keys in the directory will have two new files: key-name and key-name.pub. The first file contains the private key and the second is public key.
For more information, see Generating a new SSH key and adding it to the ssh-agent
Adding a SSH key to a GitHub repository
- Open the Git repository in GitHub.
- Go to Settings -> Deploy keys.
- Click on Add deploy key.
- Enter a title and copy the public key from the .pub file into the Key text-box.
- Make sure the Allow write access checkbox is checked so that Clai will be able to push.
- Click Save to add this key to your repo.
You should now be able to see a new key with the title you chose listed under the Deploy keys header.
Connecting Clai to Git
Open your project in Clai and navigate to Settings -> Git credentials.
Copy your Git connection string into the Git repository field followed by #branch-name where #branch-name is the name of an existing branch in your repository that Clai will use to store the current project.
A SSH key is made up of two files, one with a public key and one with a private key. Copy the text from the .pub file into the public field and the text from the other file into the private field.
Click on Save to save your credentials.
To confirm that you are connected to Git, navigate back to the stories screen and verify that the git button is visible in the top bar.
Note that git button will be disabled if your project is unable to connect to a Rasa instance as the conversion of imported and exported files relies on Rasa.
Once your project is connected to a git repository the git button will appear in the main top bar. Click on this button to open a dropdown with two actions: Commit and push, and Revert to previous.
Commit and push
To save your changes to the connected repo click on the Commit and push option in the git button dropdown. In the modal dialogue that opens enter a commit message that describes the changes you have made to the project then click Push to remote to save your changes.
If your changes were successfully saved a green alert will appear in the top right of your screen.
If there have been no changes since you last committed a yellow alert will appear in the top right corner of your screen.
If Clai is unable to commit and push a red alert containing an error message will appear in the top right corner of your screen.
Revert to previous
To revert to a previous version of your project click on the Revert to previous option in the git button dropdown. In the modal dialogue that opens find the commit that you would like to revert to, hover your mouse over the row, and then click on the Revert button that appears.
If your project contains any unsaved changes it will save them with the commit message Project state before revert to commitId before reverting to the selected commit.
⚠️ Prior to do revert we recommend to export your project.
2. Connecting using HTTPS
Generating a HTTPS token
You can access and write data in repositories on GitHub.com using HTTPS (Hypertext Transfer Protocol Secure).For this you have to generate http token in Profile > Settings > Developer settings > Personal access tokens > Generate new token
Add the generated http token in https://user:token@domain/org/repo.git#branch format.
Connecting Clai to Git using HTTPS
Paste the https in the above format in Project Settings > Git credentials > Git repository and then save.