Set up GitHub
To set up GitHub for use with git in RStudio or JupyterLab, you’ll need to:
- Create an SSH key.
- Add the SSH key to GitHub.
- Configure your username and email in git on the Analytical Platform.
Create an SSH key
You can create an SSH key in RStudio or JupyterLab. You must create a separate SSH key for each tool that you use.
RStudio
To create an SSH key in RStudio:
- Open RStudio from the Analytical Platform control panel.
- In the menu bar, select Tools then Global Options…
- In the options window, select Git/SVN in the navigation menu.
- Select Create RSA key…
- Select Create.
- Select Close when the information window appears.
- Select View public key.
- Copy the SSH key to the clipboard by pressing Ctrl+C on Windows or ⌘C on Mac.
JupyterLab
To create an SSH key in JupyterLab, follow the steps below:
- Open JupyerLab from the Analytical Platform control panel.
- Select the + icon in the file browser to open a new Launcher tab.
- Select Terminal from the ‘Other’ section.
Create an SSH key by running:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Here, you should substitute the email address you used to sign up to GitHub.
When prompted to enter a file in which to save the key, press Enter to accept the default location.
When prompted to enter a passphrase, press Enter to not set a passphrase.
View the SSH key by running:
cat /home/jovyan/.ssh/id_rsa.pub
Select the SSH key and copy it to the clipboard by pressing Ctrl+C on windows or ⌘C on Mac.
Add the SSH key to GitHub
To add the SSH key to GitHub, you should follow the guidance from GitHub.
Configure your username and email in git on the Analytical Platform
To configure your username and email in git on the Analytical Platform using RStudio or JupyterLab, follow the steps below:
- Open a new terminal:
- In RStudio, select Tools in the menu bar and then Shell…
- In JupyterLap, select the + icon in the file browser and then select Terminal from the Other section in the new Launcher tab.
Configure your username by running:
git config --global user.name 'Your Name'
Here, you should substitute your name.
Configure your email address by runnung:
git config --global user.email 'your_email@example.com'
Here, you should substitute the email address you used to sign up to GitHub.