Commit 0eaaa421 authored by Mihai's avatar Mihai

Updated remotes presentation code

parent bdc7d7f0
...@@ -108,15 +108,15 @@ ...@@ -108,15 +108,15 @@
\subsection{Updating remote commits: \texttt{git fetch}} \subsection{Updating remote commits: \texttt{git fetch}}
\begin{pframe} \begin{pframe}
\begin{lstlisting} \begin{framed}
$ git fetch hue \prompt\ \gitcmd\ \cmd{fetch} \cmdarg{hue}\\
remote: Counting objects: 5, done. \cliout{remote: Counting objects: 5, done.}
remote: Compressing objects: 100% (2/2), done. \cliout{remote: Compressing objects: 100\% (2/2), done.}\\
remote: Total 3 (delta 0), reused 0 (delta 0) \cliout{remote: Total 3 (delta 0), reused 0 (delta 0)}\\
Unpacking objects: 100% (3/3), done. \cliout{Unpacking objects: 100\% (3/3), done.}\\
From 192.168.0.8:docs/tv-series \cliout{From 192.168.0.8:docs/tv-series}\\
* [new branch] master -> hue/master \cliout{ * [new branch] master -> hue/master}\\
\end{lstlisting} \end{framed}
\pause \pause
\includegraphics[width=10cm]{example-hue} \includegraphics[width=10cm]{example-hue}
...@@ -125,13 +125,13 @@ From 192.168.0.8:docs/tv-series ...@@ -125,13 +125,13 @@ From 192.168.0.8:docs/tv-series
\subsection{Merging remote information: \texttt{git merge}} \subsection{Merging remote information: \texttt{git merge}}
\begin{pframe} \begin{pframe}
We can merge the commits from a remote into our own. We can merge the commits from a remote into our own.
\begin{lstlisting} \begin{framed}
$ git merge hue/master \prompt\ \gitcmd\ \cmd{merge} \cmdarg{hue/master}\\
Updating c7f3bd9..251a51b \cliout{Updating c7f3bd9..251a51b}\\
Fast-forward \cliout{Fast-forward}\\
testlib.py | 2 + \cliout{testlib.py | 2 +}\\
1 file changed, 2 insertions(+) \cliout{1 file changed, 2 insertions(+)}
\end{lstlisting} \end{framed}
\pause \pause
\includegraphics[width=10cm]{example-hue-merged} \includegraphics[width=10cm]{example-hue-merged}
...@@ -141,10 +141,10 @@ testlib.py | 2 + ...@@ -141,10 +141,10 @@ testlib.py | 2 +
\begin{pframe} \begin{pframe}
If we add some more commits, our local repository gets ahead of the remote If we add some more commits, our local repository gets ahead of the remote
repository. repository.
\begin{lstlisting} \begin{framed}
$ ... \prompt\ ... \\
$ git commit \prompt\ \gitcmd\ \cmd{commit}
\end{lstlisting} \end{framed}
\pause \pause
\includegraphics[width=10cm]{example-hue-ahead} \includegraphics[width=10cm]{example-hue-ahead}
...@@ -153,16 +153,16 @@ $ git commit ...@@ -153,16 +153,16 @@ $ git commit
\subsection{Pushing changes to a remote: \texttt{git push}} \subsection{Pushing changes to a remote: \texttt{git push}}
\begin{pframe} \begin{pframe}
\vspace{-0.5cm} \vspace{-0.5cm}
\begin{lstlisting} \begin{framed}
$ git push hue master \prompt\ \gitcmd\ \cmd{push} \cmdarg{hue} \cmdarg{master}\\
Counting objects: 5, done. \cliout{Counting objects: 5, done.}\\
Delta compression using up to 4 threads. \cliout{Delta compression using up to 4 threads.}\\
Compressing objects: 100% (2/2), done. \cliout{Compressing objects: 100\% (2/2), done.}\\
Writing objects: 100% (3/3), 303 bytes, done. \cliout{Writing objects: 100\% (3/3), 303 bytes, done.}\\
Total 3 (delta 1), reused 0 (delta 0) \cliout{Total 3 (delta 1), reused 0 (delta 0)}\\
To hue.remote:docs/tv-series \cliout{To hue.remote:docs/tv-series}\\
0535b7e..0676334 simpsons -> simpsons \cliout{0535b7e..0676334 simpsons -> simpsons}
\end{lstlisting} \end{framed}
\pause \pause
\includegraphics[width=9cm]{example-hue-pushed} \includegraphics[width=9cm]{example-hue-pushed}
...@@ -170,44 +170,52 @@ To hue.remote:docs/tv-series ...@@ -170,44 +170,52 @@ To hue.remote:docs/tv-series
\subsection{Cloning an existing repository} \subsection{Cloning an existing repository}
\begin{pframe} \begin{pframe}
Instead of creating repositories using \lstinline{git init}, you can create a Instead of creating repositories using \gitcmd\ \cmd{init}, you can create a
local {\em clone} of an existing (remote) repository. local {\em clone} of an existing (remote) repository.
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize] \begin{framed}
$ git clone https://git.lumc.nl/zorro/tv-series.git \prompt\ \gitcmd\ \cmd{clone} \cmdarg{https://git.lumc.nl/zorro/tv-series.git}\\
Cloning into 'tv-series'... \cliout{Cloning into 'tv-series'...}\\
remote: Counting objects: 6, done. \cliout{remote: Counting objects: 6, done.}\\
remote: Compressing objects: 100% (4/4), done. \cliout{remote: Compressing objects: 100\% (4/4), done.}\\
remote: Total 6 (delta 1), reused 0 (delta 0) \cliout{remote: Total 6 (delta 1), reused 0 (delta 0)}\\
Unpacking objects: 100% (6/6), done. \cliout{Unpacking objects: 100\% (6/6), done.}
\end{lstlisting} \end{framed}
\pause \end{pframe}
A remote called \lstinline{origin} is added for the original repository \begin{pframe}
A remote called \cmdarg{origin} is added for the original repository
automatically. automatically.
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize] \begin{framed}
$ cd tv-series/ \prompt\ \cmd{cd} \cmdarg{tv-series/}\\
$ git remote -v \prompt\ \gitcmd\ \cmd{remote} \cmdopt{-v}\\
origin https://git.lumc.nl/zorro/tv-series.git (fetch) \small{
origin https://git.lumc.nl/zorro/tv-series.git (push) \cliout{origin https://git.lumc.nl/zorro/tv-series.git (fetch)}\\
\end{lstlisting} \cliout{origin https://git.lumc.nl/zorro/tv-series.git (push)}}
\end{framed}
\end{pframe} \end{pframe}
\subsection{Shortcuts for pulling and pushing} \subsection{Shortcuts for pulling and pushing}
\begin{pframe} \begin{pframe}
The full forms of \lstinline{git push/fetch/merge} get boring quickly, so The full forms of \gitcmd\ \cmd{push}/\cmd{fetch}/\cmd{merge} get boring quickly, so
there are some shortcuts. there are some shortcuts.
\bigskip \bigskip
\pause \pause
For example, if our remote is called \lstinline{origin}: For example, if our remote is called \cmdarg{origin}:
\begin{lstlisting} \vspace{-0.3cm}
$ git push ==> $ git push origin master \begin{framed}
\end{lstlisting} \prompt\ \gitcmd\ \cmd{push}\\
--------\\
\prompt\ \gitcmd\ \cmd{push} \cmdarg{origin} \cmdarg{master}
\end{framed}
\vspace{-0.6cm}
\begin{lstlisting} \begin{framed}
$ git pull ==> $ git fetch origin \prompt\ \gitcmd\ \cmd{pull}\\
$ git merge origin/master --------\\
\end{lstlisting} \prompt\ \gitcmd\ \cmd{fetch} \cmdarg{origin}\\
\prompt\ \gitcmd\ \cmd{merge} \cmdarg{origin/master}
\end{framed}
\end{pframe} \end{pframe}
\subsection{Shortcuts for pulling and pushing (setup)} \subsection{Shortcuts for pulling and pushing (setup)}
...@@ -216,11 +224,11 @@ $ git pull ==> $ git fetch origin ...@@ -216,11 +224,11 @@ $ git pull ==> $ git fetch origin
there are some shortcuts. there are some shortcuts.
\bigskip \bigskip
This needs configuration by using \lstinline{git push} with \lstinline{-u} This needs configuration by using \gitcmd\ \cmd{push} with \cmdopt{-u}
once: once:
\begin{lstlisting} \begin{framed}
$ git push origin master -u \prompt\ \gitcmd\ \cmd{push} \cmdarg{origin} \cmdarg{master} \cmdopt{-u}
\end{lstlisting} \end{framed}
If your repository was created by cloning, this is already done. If your repository was created by cloning, this is already done.
\end{pframe} \end{pframe}
...@@ -238,9 +246,9 @@ $ git push origin master -u ...@@ -238,9 +246,9 @@ $ git push origin master -u
\subsection{The HTTP(S) protocol} \subsection{The HTTP(S) protocol}
\begin{pframe} \begin{pframe}
Most popular protocol when the remote repository is on a server. Most popular protocol when the remote repository is on a server.
\begin{lstlisting} \begin{framed}
$ git clone https://example.com/gitproject.git \prompt\ \gitcmd\ \cmd{clone} \cmdarg{https://example.com/gitproject.git}
\end{lstlisting} \end{framed}
For pushing (or fetching if the repository is private), this asks for your For pushing (or fetching if the repository is private), this asks for your
username and password everytime. username and password everytime.
...@@ -250,9 +258,9 @@ $ git clone https://example.com/gitproject.git ...@@ -250,9 +258,9 @@ $ git clone https://example.com/gitproject.git
\begin{pframe} \begin{pframe}
Most convenient protocol when the remote repository is private or you are a Most convenient protocol when the remote repository is private or you are a
regular contributor. regular contributor.
\begin{lstlisting} \begin{framed}
$ git clone user@example.com:gitproject.git \prompt\ \gitcmd\ \cmd{clone} \cmdarg{user@example.com:gitproject.git}
\end{lstlisting} \end{framed}
This usually requires public/private key authentication. This usually requires public/private key authentication.
\end{pframe} \end{pframe}
......
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