remotes_handouts.tex 2.03 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
\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.
22 23

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

\bigskip

29
Add a remote for your GitLab repository.
30 31 32

\bigskip

33
Push your branch(es) to GitLab.
34 35

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

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

46 47
\bigskip

48
Create a local clone of the repository you picked.
49 50

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

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.

61 62
\bigskip

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.
65 66 67

\bigskip

68
Clone the project (your fork) to your local machine.
69 70 71

\bigskip

72 73
Create a new branch and implement some feature in it. Make sure to commit
this.
74

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.
84 85 86

\bigskip

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

\end{document}