remotes_handouts.tex 2.91 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
\documentclass{article}
\usepackage{fullpage}

\frenchspacing
\setlength{\parindent}{0pt}
\pagestyle{empty}

\begin{document}
\begin{center}
{\bf Git Introduction Course}

Git and remote repositories practical.
\end{center}
\bigskip

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
\subsubsection*{Some notes about using GitLab.}
Please take the following into account with respect to our GitLab server:
\begin{itemize}
  \item You can login to GitLab using your LUMC account.
  \item If you don't have an LUMC account, ask us to create a GitLab account
    for you and select {\em Standard} instead of {\em LDAP} on the login
    page.
  \item Due to the LUMC firewall, accessing repositories using SSH is only
    possible from the LUMC network (and not from the LUMC gast network). As an
    alternative, you can always use HTTPS but the downside is that you have to
    keep repeating your password.
  \item Our GitLab server is very similar (in fact, it is a clone) to the
    popular online GitHub (\texttt{https://github.com}) and Bitbucket
    (\texttt{https://bitbucket.org}) services.
\end{itemize}

\bigskip

34 35 36 37 38
\subsubsection*{Add your repository to GitLab.}
Now you have a nice repository, of course you want to share it on GitLab.

\bigskip

39
Go to GitLab (\texttt{https://git.lumc.nl}) and create a new project.
40 41

\begin{itemize}
42
  \item \emph{Question:} What is the repository URL for your new project?
43 44 45 46
\end{itemize}

\bigskip

47
Add the GitLab repository as a remote to your local repository.
48 49 50

\bigskip

51
Push your branch(es) to GitLab.
52 53

\begin{itemize}
54 55
  \item \emph{Question:} Can you see your repository content in the GitLab web
    interface?
56 57
\end{itemize}

58
\bigskip
59 60 61 62 63 64

\subsubsection*{Clone an existing repository from GitLab.}
There already are some nice repositories on GitLab! Pick one (e.g., from the
person sitting next to you, or browse the public repositories using the globe
icon in the top right).

65 66
\bigskip

67
Create a local clone of the repository you picked.
68 69

\begin{itemize}
70 71
  \item \emph{Question:} In the resulting repository, what remotes and
    branches exist?
72 73
\end{itemize}

74
\bigskip
75

76
\subsubsection*{Create a merge request.}
77 78 79 80
If you are interested, here are some additional GitLab features you can
use. Fork an existing project, implement a feature, and submit a merge
request.

81 82
\bigskip

83 84
Find an interesting project and click the \emph{Fork} button. This makes a
copy of the project under your own user, on GitLab.
85 86 87

\bigskip

88
Clone the project (your fork) to your local machine.
89 90 91

\bigskip

92 93
Create a new branch and implement some feature in it. Make sure to commit
this.
94

95 96 97 98 99 100 101 102 103
\bigskip

Push your new branch to GitLab (your fork of the project).

\bigskip

If you now go to your GitLab dashboard (homepage), you'll see a green button
to create a merge request. From the merge request, the owner of the original
project can directly merge your changes using only the web interface.
104 105 106

\bigskip

107 108
\emph{Hint:} You can also start a discussion or do some code review inside the
merge request.
109 110

\end{document}