Commit c9f3aa01 authored by Arnaud Legrand's avatar Arnaud Legrand

Separate GitLab Instructions from Rstudio instructions

parent 3f103163
......@@ -11,6 +11,9 @@ emacs configuration_ and _A stub of replicable article_ explain how to
set up org-mode for this MOOC. *You really should follow them
carefully or you may have trouble doing the exercices later on*.
The next sections provide information on how to install emacs. Before
proceeding, make sure you have read the "Git and GitLab" instructions.
* Installing emacs, org-mode, ess, and auctex.
** OS-specific installation procedure
*** Linux (Debian, Ubuntu)
......
# -*- mode: org -*-
#+TITLE: Git and GitLab
#+AUTHOR: Arnaud Legrand
#+DATE: June, 2018
#+STARTUP: overview indent
#+OPTIONS: num:nil toc:t
#+PROPERTY: header-args :eval never-export
So far, you only used git via the web interface from the GitLab we
deployed for the MOOC.
#+BEGIN_CENTER
https://app-learninglab.inria.fr/gitlab/
#+END_CENTER
If you access this link from the FUN platform, you do not have to
authenticate and you can readily read and modify all your files. This
is very convenient but in most cases, you will want to have your own
local copy of the repository and you will have to synchronize your
local copy with the remote GitLab one. To propagate your
modifications, you will obviously have to authenticate yourself on
GitLab. This document describes the software you need to have
installed on your machine and how to handle authentification. Please
read these instructions carefully.
* Installing Git
** Linux (debian, ubuntu)
We provide here only instructions for debian-based distributions. Feel
free to contribute to this document to provide up-to-date information
for other distributions (e.g., redhat, fedora).
Run (as root):
#+begin_src sh :results output :exports both
apt-get update ; apt-get install git
#+end_src
** Mac OSX and Windows
- Download and install Git from the [[https://git-scm.com/downloads][Git website]].
- Optional Git clients (should not be needed if you work within
Rstudio):
- [[https://www.sourcetreeapp.com/][SourceTree]]
- [[https://desktop.github.com/][GitHub Desktop]]
#+BEGIN_QUOTE
[[https://github.com/desktop/desktop/issues/852][Apparently]], this works with GitLab and https.
#+END_QUOTE
* Authenticating on GitLab
There are two ways of authenticating and synchronizing your local
repository with GitLab: through HTTPS or through SSH. The first one
does not require any particular software installation on your machine
so this is what I recommend for this MOOC. Yet, I also describe the
second one as it is the one I prefer (once it is well configured, it
never asks me for any password anymore and I don't have to remember
anything).
** Option 1: HTTPS
*** Configuring your GitLab password
In this video, I explain how to change your password on our GitLab.
#+BEGIN_CENTER
Youtube Video
#+END_CENTER
*** Making sure git remembers your password
My GitLab id is =3211ac4f2fb71deaeff9252764c368e7=. Say I've configured
my password to be =tototutu= (what a weak password...) and I want to
clone my =mooc-rr= repository. If you clone your repos by simply pasting
the GitLab url (e.g., with the following command line) you will be
prompted for your login and your password every time you want to
propagate your local modifications.
#+begin_src shell :results output :exports both
git clone https://app-learninglab.inria.fr/gitlab/3211ac4f2fb71deaeff9252764c368e7/mooc-rr
#+end_src
This can be quite painful, which is why you can also provide them once
and for all when cloning, as follows:
#+begin_src shell :results output :exports both
git clone https://3211ac4f2fb71deaeff9252764c368e7:tototutu@app-learninglab.inria.fr/gitlab/3211ac4f2fb71deaeff9252764c368e7/mooc-rr
#+end_src
This is very convenient but there is one drawback to understand. This
means your password is stored, unencrypted on your hard drive. If
anyone ever gets an access to your machine, he will gain access rights
to all your repos, which can be problematic. This is why the really
good way to do this is to follow [[https://stackoverflow.com/questions/5343068/is-there-a-way-to-skip-password-typing-when-using-https-on-github][these instructions]]:
#+begin_src shell :results output :exports both
git config --global credential.helper cache # remember my password
git config --global credential.helper "cache --timeout=3600" # for one hour at most
#+end_src
With this setup, you will be prompted for your password but it will be
cached in memory and they will not be asked again before an hour.
** Option 2: SSH
My prefered (although more technical) solution is to install SSH, to
create a pair or private/public keys, and to upload your SSH public
key on GitLab. This section provides with information on how to do
this.
*** Installing SSH
**** Linux (debian, ubuntu)
We provide here only instructions for debian-based distributions. Feel
free to contribute to this document to provide up-to-date information
for other distributions (e.g., redhat, fedora).
Run (as root):
#+begin_src sh :results output :exports both
apt-get update ; apt-get install openssh-client
#+end_src
**** Mac OSX
You do not have anything to do as it is installed by default.
**** Windows
You should install the [[https://www.ssh.com/ssh/putty/windows/][Putty]] client. Once it is installed, look for
the section on [[https://www.ssh.com/ssh/putty/windows/puttygen][generating an SSH key]].
*** Setting up SSH on Framagit
Here are [[https://docs.gitlab.com/ee/ssh/][all the official explanations on how to set up your SSH key
on GitLab]]. Alternatively, you may also want to have a look at this
video:
#+BEGIN_EXPORT html
<iframe width="560" height="315" src="https://www.youtube.com/embed/54mxyLo3Mqk" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
#+END_EXPORT
......@@ -14,16 +14,15 @@ may want to watch this video:
<iframe width="854" height="480" src="https://www.youtube.com/embed/uHYcDQDbMY8" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
#+END_EXPORT
The next sections provide information on how to install Rstudio, Git
(to interact with GitLab), and SSH (to avoid typing your password
every time you synchronize with GitLab).
The next sections provide information on how to install Rstudio. Before
proceeding, make sure you have read the "Git and GitLab" instructions.
Finally, you need to know that the Rstudio team has created a lot of
very good material and tutorials. You should definitively look at the
[[https://www.rstudio.com/resources/cheatsheets/][Cheat sheets webpage]]. In particular you want to have look at the ones
on:
- [[https://github.com/rstudio/cheatsheets/raw/master/rstudio-ide.pdf][The Rstudio IDE]],
- [[https://github.com/rstudio/cheatsheets/raw/master/rmarkdown-2.0.pdf][R Markdown]],
- [[https://github.com/rstudio/cheatsheets/raw/master/rmarkdown-2.0.pdf][R Markdown]] (here is also a [[https://rmarkdown.rstudio.com/][nice step-by-step presentation of Rmarkdown]]),
- The [[https://www.rstudio.com/wp-content/uploads/2015/03/rmarkdown-reference.pdf][R Markdown Reference guide]],
- [[https://github.com/rstudio/cheatsheets/raw/master/data-visualization-2.1.pdf][Data visualization with ggplot2]],
- [[https://github.com/rstudio/cheatsheets/raw/master/data-transformation.pdf][Data transformation with dplyr]]
......@@ -97,52 +96,3 @@ install knitr and ggplot2:
install.packages("knitr")
install.packages("ggplot2")
#+END_SRC
* Installing Git
** Linux (debian, ubuntu)
We provide here only instructions for debian-based distributions. Feel
free to contribute to this document to provide up-to-date information
for other distributions (e.g., redhat, fedora).
Run (as root):
#+begin_src sh :results output :exports both
apt-get update ; apt-get install git
#+end_src
** Mac OSX and Windows
- Download and install Git from the [[https://git-scm.com/downloads][Git website]].
- Optional Git clients (should not be needed if you work within
Rstudio):
- [[https://www.sourcetreeapp.com/][SourceTree]]
- [[https://desktop.github.com/][GitHub Desktop]]
#+BEGIN_QUOTE
[[https://github.com/desktop/desktop/issues/852][Apparently]], this works with GitLab and https.
#+END_QUOTE
* Setting up SSH
There are two ways of synchronizing your local repository with GitLab:
through HTTPS or through SSH. The first one does not require any
particular configuration but you will be regularly prompted for your
GitLab password, which can be quite tedious. To avoid this, the best
solution is to set install SSH, to create a pair or private/public
keys, and to upload your SSH public key on GitLab. This section
provides with information on how to do this.
** Installation
*** Linux (debian, ubuntu)
We provide here only instructions for debian-based distributions. Feel
free to contribute to this document to provide up-to-date information
for other distributions (e.g., redhat, fedora).
Run (as root):
#+begin_src sh :results output :exports both
apt-get update ; apt-get install openssh-client
#+end_src
*** Mac OSX
You do not have anything to do as it is installed by default.
*** Windows
You should install the [[https://www.ssh.com/ssh/putty/windows/][Putty]] client. Once it is installed, look for
the section on [[https://www.ssh.com/ssh/putty/windows/puttygen][generating an SSH key]].
** Setting up SSH on Framagit
Here are [[https://docs.gitlab.com/ee/ssh/][all the official explanations on how to set up your SSH key
on GitLab]]. Alternatively, you may also want to have a look at this
video:
#+BEGIN_EXPORT html
<iframe width="560" height="315" src="https://www.youtube.com/embed/54mxyLo3Mqk" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
#+END_EXPORT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment