Authenticating with Git
To clone, push, or pull changes from a repository in Worktree, you need to authenticate so we know who you are and can verify which repositories you can access.
Authenticating with Git is only required when setting up your own computer and devices, and gives full access to all your repositories. NEVER grant anyone else access to your Worktree account, or authorize SSH keys you don't personally control.
The recommended method is to use SSH connections with an SSH keypair. This is the most secure option, and also is the easiest to get set up.
1. Generating an SSH Keypair
If you don't already have an SSH keypair, generate one with the ssh command line utility, ssh-keygen
.
There are multiple different types of keys, all using different strengths and types of encryption. We recommend generating an "ED25519" key, which is more modern option; however, the default remains RSA, which is older but still plenty secure for general use. Worktree supports both RSA and EC SSH key algorithms, so it is your choice.
To generate a key, use ssh-keygen
and follow the prompts it asks you. The defaults should be fine, if in doubt. Your output should look similar to below:
$ ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in ~/.ssh/id_ed25519
Your public key has been saved in ~/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:4DMylRl5VNmEb4JCJnjkj68gqvqkJrzCLUPBjDiQxDk ablackie@monarch.yul-1.blackie.ca
The key's randomart image is:
+--[ED25519 256]--+
|oo.o. .o...=. |
|oE..o ++. o . |
|* ...+=. . . |
|++ =... . o |
| .. + =.S o |
| . + o |
|= + . |
|+X o . |
|@o= . |
+----[SHA256]-----+
2. Import your SSH public key
With your SSH keypair in hand, you can now import it into your Worktree account to use for authentication.
Click on your profile picture in the top right and go to "Settings".
From there go to "SSH / GPG Keys" in the menu on the left.
Here, click "Add Key", and paste in the public key generated by ssh-keygen (the one ending in ".pub").
That should be all that is required to access Git repositories over SSH in Worktree!