It is preferred that you use SSH to check in code. You will need an SSH key associated with your GitHub account to do this. You can follow the guide created by GitHub, or the steps below.
The following steps are for MacOS. Follow the guide linked above for other operating systems.
The following steps are for MacOS. Follow the guide linked above for other operating systems.
- Generate an SSH private-public key pair. Open a terminal on your machine and enter
- ssh-keygen -t rsa
- You will be asked where to save the key. The default (~/.ssh/id_rsa) will suffice.
- You will be asked for a secure passphrase. If you enter one, you will be asked for this phrase every time you commit changes. Be sure to remember it.
- Add the newly generated private key to your SSH agent. Use the following command.
- ssh-add -K ~/.ssh/id_rsa
- Add the newly generated public key (~/.ssh/id_rsa.pub) to GitHub. Go to your account settings and select "SSH and GPG keys". Press "New SSH key".
- Give your key a meaningful title (i.e. your computer's name or "Work Laptop")
- Copy the public key. The easiest way to do this is with the following command. Alternatively you may open ~/.ssh/id_rsa.pub with your favourite text editor and copy it.
- pbcopy < ~/.ssh/id_rsa.pub
- Paste the key into the "Key" box. Press "Add SSH key".
Comments
Post a Comment