remotes_handouts.tex 2.03 KB
Newer Older
Martijn Vermaat's avatar
Martijn Vermaat committed
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

Martijn Vermaat's avatar
Martijn Vermaat committed
16 17 18 19 20 21
\subsubsection*{Add your repository to GitLab.}
Now you have a nice repository, of course you want to share it on GitLab.

\bigskip

Go to GitLab and create a new project.
Martijn Vermaat's avatar
Martijn Vermaat committed
22 23

\begin{itemize}
Martijn Vermaat's avatar
Martijn Vermaat committed
24
  \item \emph{Question:} What is the repository URL for your new project?
Martijn Vermaat's avatar
Martijn Vermaat committed
25 26 27 28
\end{itemize}

\bigskip

Martijn Vermaat's avatar
Martijn Vermaat committed
29
Add a remote for your GitLab repository.
Martijn Vermaat's avatar
Martijn Vermaat committed
30 31 32

\bigskip

Martijn Vermaat's avatar
Martijn Vermaat committed
33
Push your branch(es) to GitLab.
Martijn Vermaat's avatar
Martijn Vermaat committed
34 35

\begin{itemize}
Martijn Vermaat's avatar
Martijn Vermaat committed
36 37
  \item \emph{Question:} Can you see your repository content in the GitLab web
    interface?
Martijn Vermaat's avatar
Martijn Vermaat committed
38 39
\end{itemize}

Martijn Vermaat's avatar
Martijn Vermaat committed
40 41 42 43 44 45

\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).

Martijn Vermaat's avatar
Martijn Vermaat committed
46 47
\bigskip

Martijn Vermaat's avatar
Martijn Vermaat committed
48
Create a local clone of the repository you picked.
Martijn Vermaat's avatar
Martijn Vermaat committed
49 50

\begin{itemize}
Martijn Vermaat's avatar
Martijn Vermaat committed
51 52
  \item \emph{Question:} In the resulting repository, what remotes and
    branches exist?
Martijn Vermaat's avatar
Martijn Vermaat committed
53 54
\end{itemize}

Martijn Vermaat's avatar
Martijn Vermaat committed
55 56 57 58 59 60

\subsubsection*{For experts: create a merge request.}
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.

Martijn Vermaat's avatar
Martijn Vermaat committed
61 62
\bigskip

Martijn Vermaat's avatar
Martijn Vermaat committed
63 64
Find an interesting project and click the \emph{Fork} button. This makes a
copy of the project under your own user, on GitLab.
Martijn Vermaat's avatar
Martijn Vermaat committed
65 66 67

\bigskip

Martijn Vermaat's avatar
Martijn Vermaat committed
68
Clone the project (your fork) to your local machine.
Martijn Vermaat's avatar
Martijn Vermaat committed
69 70 71

\bigskip

Martijn Vermaat's avatar
Martijn Vermaat committed
72 73
Create a new branch and implement some feature in it. Make sure to commit
this.
Martijn Vermaat's avatar
Martijn Vermaat committed
74

Martijn Vermaat's avatar
Martijn Vermaat committed
75 76 77 78 79 80 81 82 83
\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.
Martijn Vermaat's avatar
Martijn Vermaat committed
84 85 86

\bigskip

Martijn Vermaat's avatar
Martijn Vermaat committed
87 88
\emph{Hint:} You can also start a discussion or do some code review inside the
merge request.
Martijn Vermaat's avatar
Martijn Vermaat committed
89 90

\end{document}