remotes_handouts.tex 2.91 KB
 Martijn Vermaat committed Oct 14, 2013 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 committed Jun 20, 2014 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  Martijn Vermaat committed Oct 14, 2013 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  Martijn Vermaat committed Jun 20, 2014 39 Go to GitLab (\texttt{https://git.lumc.nl}) and create a new project.  Martijn Vermaat committed Oct 14, 2013 40 41  \begin{itemize}  Martijn Vermaat committed Oct 14, 2013 42  \item \emph{Question:} What is the repository URL for your new project?  Martijn Vermaat committed Oct 14, 2013 43 44 45 46 \end{itemize} \bigskip  Martijn Vermaat committed Jun 20, 2014 47 Add the GitLab repository as a remote to your local repository.  Martijn Vermaat committed Oct 14, 2013 48 49 50  \bigskip  Martijn Vermaat committed Oct 14, 2013 51 Push your branch(es) to GitLab.  Martijn Vermaat committed Oct 14, 2013 52 53  \begin{itemize}  Martijn Vermaat committed Oct 14, 2013 54 55  \item \emph{Question:} Can you see your repository content in the GitLab web interface?  Martijn Vermaat committed Oct 14, 2013 56 57 \end{itemize}  Martijn Vermaat committed Jun 20, 2014 58 \bigskip  Martijn Vermaat committed Oct 14, 2013 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).  Martijn Vermaat committed Oct 14, 2013 65 66 \bigskip  Martijn Vermaat committed Oct 14, 2013 67 Create a local clone of the repository you picked.  Martijn Vermaat committed Oct 14, 2013 68 69  \begin{itemize}  Martijn Vermaat committed Oct 14, 2013 70 71  \item \emph{Question:} In the resulting repository, what remotes and branches exist?  Martijn Vermaat committed Oct 14, 2013 72 73 \end{itemize}  Martijn Vermaat committed Jun 20, 2014 74 \bigskip  Martijn Vermaat committed Oct 14, 2013 75   Martijn Vermaat committed Jun 20, 2014 76 \subsubsection*{Create a merge request.}  Martijn Vermaat committed Oct 14, 2013 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.  Martijn Vermaat committed Oct 14, 2013 81 82 \bigskip  Martijn Vermaat committed Oct 14, 2013 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.  Martijn Vermaat committed Oct 14, 2013 85 86 87  \bigskip  Martijn Vermaat committed Oct 14, 2013 88 Clone the project (your fork) to your local machine.  Martijn Vermaat committed Oct 14, 2013 89 90 91  \bigskip  Martijn Vermaat committed Oct 14, 2013 92 93 Create a new branch and implement some feature in it. Make sure to commit this.  Martijn Vermaat committed Oct 14, 2013 94   Martijn Vermaat committed Oct 14, 2013 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.  Martijn Vermaat committed Oct 14, 2013 104 105 106  \bigskip  Martijn Vermaat committed Oct 14, 2013 107 108 \emph{Hint:} You can also start a discussion or do some code review inside the merge request.  Martijn Vermaat committed Oct 14, 2013 109 110  \end{document}