Configuring a Git SSH Key

If you're cloning a project from a Git remote provider (like GitLab) and using an SSH link, you'll first have to create an SSH key on your computer to authenticate with the repository. Otherwise, you won't be able to sync (publish a branch, create a pull request, etc.).
This article will show you how to generate a new SSH key and add it to your GitHub and GitLab accounts. Refer here for the complete set of instructions as published by GitHub, here for GitLab docs, and here for instructions on adding a remote project through Codux.
Important!
You're going to see this error if you're working on a project from a Git remote provider, and you didn't configure the key as described in this article.

Generate the key 

First, you'll need to generate a new SSH key. On Linux and macOS, you can do this by opening a terminal window. On Windows, open Git Bash (installed with Git by default). Then run the following command:
1
ssh-keygen -t ed25519 -C "your_email@example.com"
Replace "your_email@example.com" with your actual email address. This will generate a new SSH key pair. You can accept the default location to save the key to. Then type a secure passphrase when prompted.

Add your SSH key to your key manager 

SSH keys on your computer get managed by something called an 'ssh-agent'. Start the ssh-agent in the background using this command:
1
eval "$(ssh-agent -s)"
Then, add the key that you generated earlier to the ssh-agent like this:
1
ssh-add ~/.ssh/id_ed25519

Add the key to GitHub or GitLab 

The final step is to add the generated key to your GitHub and GitLab accounts. First, open the file on your computer using a text or code editor and copy the contents. As an example, if you used the default path when you generated the key, you'll find a file like this: /home/[user]/.ssh/id_ed25519.pub Open the file, and copy the text which look like this:
1
ssh-ed25519 AAAAD4NzaC1lZDI1NTE5AAAAIHzuQ1c48erHhiAW0RZsRzGs0+IypExC2PQBUdH347tx your_email@example.com
On Windows computers, the default location of the file is `C:\Users\[user]\.ssh\id_ed25519.pub`.
Then, in GitHub, go to your settings page and click "SSH and GPG keys". Click "New SSH key" and paste in the contents of the file. On GitLab, go to your profile settings and click "SSH Keys". Then, click "New key" and paste in your public key.
That's it! Just open the project you cloned to your computer as a local project in Codux and you'll be able to sync the project back to your repo without any trouble. If it's a GitHub project, you'll see "open pull request" in the menu to take you to GitHub, and if it's a GitLab project, you'll see "open merge request" to take you to GitLab.
Note:
You may need to enter the secure passphrase that you set the first time Codux opens the project.