-
Notifications
You must be signed in to change notification settings - Fork 3
Tutorial: Git
This document is mainly about setting up GitHub. See here for GitHub basics. Since setting up ssh makes interventions easier, we recommend you to setup ssh keys on your machine.
Below is a compiled guide from the pieces in the link above.
SSH Keys are secure local keys that you can register on GitHub so that you don't have to enter your credentials each time you're accessing a remote repository. By setting up an SSH connection and registering the credentials on GitHub itself, all the verification/identification steps are taken care of by the SSH agent and you can simply push/pull the code.
In order to check:
ls -al ~/.ssh
Sample Output:
ls -al ~/.ssh
total 32
drwx------ 2 jamiecho jamiecho 4096 Sep 9 22:58 .
drwxr-xr-x 83 jamiecho jamiecho 4096 Oct 1 18:05 ..
-rw------- 1 jamiecho jamiecho 3247 Jul 27 17:17 id_rsa
-rw-r--r-- 1 jamiecho jamiecho 747 Jul 27 17:17 id_rsa.pub
-rw------- 1 jamiecho jamiecho 6870 Oct 1 02:56 known_hosts
-rw------- 1 jamiecho jamiecho 6426 Sep 9 21:56 known_hosts.old
You should find any one of id_dsa.pub, id_ecdsa.pub, id_es25519.pub, id_rsa.pub, ...
However, in most cases (i.e. new to setting up the environment), you'll be setting up Git in a computer without preconfigured ssh-keys. In this case, you should generate a new SSH key. This step is explained in the next section.
-
Generate the key by running the command below in the terminal (Do not copy-paste the below script directly):
ssh-keygen -t rsa -b 4096 -C "[email protected]"
-
When you're prompted to "Enter a file in which to save the key," press Enter.
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
This accepts the default file location.
-
At the prompt, type a secure passphrase. For more information, see Working with SSH key passphrases.
Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]
-
Ensure ssh-agent is enabled:
# start the ssh-agent in the background eval "$(ssh-agent -s)" Agent pid 59566 # sample output
-
Add your SSH Key to the ssh-agent:
ssh-add ~/.ssh/id_rsa
-
Install Xclip, which is a program that allows you to copy/paste things with CLI.
# install xclip sudo apt-get install xclip # copy id_rsa.pub to clipboard xclip -sel clip < ~/.ssh/id_rsa.pub
-
Go to your Profile Page, and click Settings.
-
In the user settings sidebar, click SSH and GPG keys.
-
Click New SSH key or Add SSH key.
-
In the "Title" field, add a descriptive label for the new key. For example, if you're using a personal Mac, you might call this key "Personal MacBook Air".
-
Paste your key (from step 1) into the "Key" field.
-
Click Add SSH Key.
-
If prompted, confirm your GitHub password.
- Tutorial: Setup and Installation
- Tutorial: Working with the Arms
- Tutorial: Motion in ROS
- Tutorial: Speech To Text
- Tutorial: OpenCV
- Tutorial: Depth Camera