11 Cloning repository
11.1 Existing repository
If you have already been invited to collaborate on a project in GitLab, the workflow goes as follows:
- Click on the upper left corner, where you see an icon resembling a fox
- That will take you back to your dashboard
- Click on a project where you have been invited
Next, click on:
Clone
, and subsequently, onCopy URL
under theClone with SSH
See the image below for details on where to click:
11.2 Clone to RStudio
Launch RStudio. Click File –> New Project –> Version Control –> Git
Press Command
+ V
, this will paste the SSH URL:
Thereafter, press Tab
. The screen will look something like here:
Now, change the folder to whatever you like. It could be, e.g.,
/Users/YOUR COMPUTER USER NAME HERE/rprojects
Note that RStudio will automatically make a subfolder with the displayed project directory name.
And boom, there you have it. You have just cloned the remote repo from GitLab to your computer.
11.3 New repository
If you haven’t been invited yet to any GitLab projects, you can make your own repository right away. You can delete if afterwards, if you want.
The workflow goes as follows:
- Click on the upper left corner, where you see an icon resembling a fox
- That will take you back to your dashboard
- Click on
New project
Next, click on “Create blank project”.
Next, you will see the following screen. Give your project a name, keep it private this time, you may create a README.md file automatically and finally, click on Create project
:
You can now proceed as if you had been invited to a GitLab project, please see the instructions above
In the next chapter, we will practice pushing to a remote repo (here: to GitLab).
Lightning Fast Git Guide by Ville Langén is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.