Commit 79b82ab4 authored by Kronberg, V.C.E.'s avatar Kronberg, V.C.E.
Browse files

* Various minor fixes and tweaks.

* Uniform indentation & removed trailing spaces.
parent ceffdbb1
Figs/tutorialPart1/firstPush1.PNG

83.5 KB | W: | H:

Figs/tutorialPart1/firstPush1.PNG

31.7 KB | W: | H:

Figs/tutorialPart1/firstPush1.PNG
Figs/tutorialPart1/firstPush1.PNG
Figs/tutorialPart1/firstPush1.PNG
Figs/tutorialPart1/firstPush1.PNG
  • 2-up
  • Swipe
  • Onion skin
......@@ -82,7 +82,7 @@ To start with:
\item Tell everyone to find a partner.
\end{itemize}
Walkthrough 1:
Walkthrough:
\hbadness=10000
\begin{itemize}
\item Log in on GitLab \url{https://GitLab.tue.nl/}.\\
......@@ -92,7 +92,7 @@ Walkthrough 1:
\item Set up SmartGit.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart1/setup1.PNG}\\
Start SmartGit and tick the terms of agreement (after reading them, of course) and select ''Non-commercial use only (most features, no support).\\
Start SmartGit and tick the terms of agreement (after reading them, of course) and select ''Non-commercial use only (most features, no support)''.\\
\includegraphics[width=\linewidth]{Figs/tutorialPart1/setup2.PNG}\\
Wait for the 10 seconds and tick both of the boxes.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart1/setup3.PNG}\\
......@@ -134,19 +134,21 @@ Walkthrough 1:
\item Add a text file to the \textit{root folder} of the repository.\\
Platform specific - anything will do and you can create a new one with some text in it.\\
Note that Microsoft files are binary files, and as such they are not suitable for git! (i.e.\ no Word documents, PowerPoint presentations, etc)
Note that Microsoft files are binary files, and as such they are not suitable for git! (i.e.\ no Word documents, PowerPoint presentations, etc).\\
Jupyter notebooks are unsuitable for similar reasons (see \url{https://opendreamkit.org/2019/10/24/rtc/} and more specifically \url{https://nbdime.readthedocs.io/} for a solution for the command line version of Git and a web-based UI).
\item \textit{Stage} the new file.\\
\includegraphics[width=0.8\linewidth]{Figs/tutorialPart1/stageButton.PNG}%
\includegraphics[width=0.2\linewidth]{Figs/tutorialPart1/stageContext.PNG}\\
Click on the ''Stage'' button in the toolbar or use the context menu entry.\\
The former will stage \textit{all} of the local changes, whilst the latter lets you be more gradual - in this case the effect will of course be the same.
Either option will stage the currently selected file(s).
\item Check if the file is on GitLab.\\
Go to \url{https://GitLab.tue.nl/} and click on the project.\\
The file is not there.
\clearpage
\item \textit{Commit} the file with a commit message.\\
\item \textit{Commit} the file with (an instructive!) commit message.\\
Go back to SmartGit.\\[5pt]
\includegraphics[width=0.8\linewidth]{Figs/tutorialPart1/commitButton.PNG}%
\includegraphics[width=0.2\linewidth]{Figs/tutorialPart1/commitContext.PNG}\\
......@@ -155,15 +157,14 @@ Walkthrough 1:
Enter a suitable commit message.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart1/commit3.PNG}\\
Now we can see the new commit that we just made.\\
Now we can see the new commit that we just made in the log.\\
Note that the ''Modification'' value changed from ''Untracked'' to ''Added''.
\item Check if file is on GitLab.\\
Go to \url{https://GitLab.tue.nl/} and click on the project.\\
The file is not there.
\item \textit{Push} the staged commits to the \textit{remote repository}.\\
Go back to SmartGit.\\[5pt]
\item \textit{Push} the commit to the \textit{remote repository}.\\
\includegraphics[width=\linewidth]{Figs/tutorialPart1/firstPush1.PNG}\\
Click the upwards facing arrow which says ''Push'', and note that the green icon which says ''master'' fits snugly into the yellow ''origin/master'' one - this indicates parity between the \textit{remote} (origin/master) and \textit{local} (master) \textit{repositories}.\\
\includegraphics[width=\linewidth]{Figs/tutorialPart1/firstPush3.PNG}
......@@ -171,13 +172,14 @@ Walkthrough 1:
\item Check GitLab once again.\\
Go to \url{https://GitLab.tue.nl/} and click on the project.\\
This time the text file is indeed available.
\clearpage
\item \textit{Ignoring} files. Quite often you will be in a situation where you have temporary files (e.g.\ when typesetting \LaTeX documents), which need not be synced to the remote repository.
\item \textit{Ignoring} files. Quite often you will be in a situation where you have temporary files (e.g.\ when typesetting \LaTeX$\ $documents), which need not be synced to the remote repository.
You can tell Git to simply ignore these files by marking them and choosing ignore.
\\[5pt]
\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart1/ignore.png}\\
After this, you will find a \texttt{.gitignore} file, which you should stage, commit and push to the remote repository.
\end{itemize}
\clearpage
This ends the first walkthrough.
Before the break, you should all try to
......@@ -186,14 +188,16 @@ Before the break, you should all try to
\item Perform a couple of \textit{commits}.
\item \textit{Stage} multiple files and several changes at once.
\item \textit{Push} a few times to the remote repository.
\item \textit{Revert} an old commit.
\item \textit{Ignore} a file, and push the resulting \texttt{.gitignore} file.
\item \textit{Revert} an old commit (right click the commit and select ''revert'') - this will omit that commit in the current HEAD (i.e.\ the current state of the local repository).
\end{itemize}
For those who want a challenge, try to
\begin{itemize}
\item \textit{Unstage} a staged commit, change some things then re-stage the new changes and commit.
\item \textit{Checkout} an old commit.
\item \textit{Reset} the repository to an older commit.
\item \textit{Unstage} a staged file, change some things then re-stage the updated file and commit.
\item \textit{Checkout} an old commit - this allows you to ''temporarily'' go back to a previous state of the repository.
\item \textit{Reset} the repository to an older commit - this can be done in a ''soft'' or ''hard'' manner, meaning that you either reset the repository to a previous state whilst retaining the proceeding commits as a stash (soft) or discard all of those commits (hard).\\
Note that a hard reset constitutes a {\color{red} destructive action}, meaning there is no way to recover the lost commits once the change is pushed to the remote repository!
\end{itemize}
\vfill
......@@ -201,68 +205,76 @@ For those who want a challenge, try to
\clearpage
Tutorial part 2:
Branches are very useful if you want to try out different approaches. Although they are most useful when working with others, even alone it is good if you want to explore a new idea.
\textit{Branches} are very useful if you want to try out different approaches. Although they are most useful when working with others, even alone they are helpful if you want to explore a new idea.
\hbadness=10000
\begin{itemize}
\item First use your repo or make a new one and make 3-4 commits on the master branch. \\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/before.png}\\
\item Create branch (Branch$\rightarrow$Add Branch). Depending on what you clicked after naming the branch, you are either still on master or are already on the new branch.
With (Branch$\rightarrow$Check out$\rightarrow$)or you simply click on the branch name in the bottom left corner. Make sure you are on your new branch. \\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/checkoutbranch.png}\\
\item Edit a file and create a new commit on the new branch. Maybe 1-2 commits.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/addtofeaturebranch.png}\\
\item Checkout the master branch again. All the changes from before are now gone (i.e. they are on the other branch). Click on the tickmark next to the branchname in the bottom left to make it visible. \\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/checkout_master.png}\\
\item Make 1 or 2 commits on the master branch.
\item Your branches should look like this now.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/branchbeforemerge.png}\\
\item Right click on your branch and select merge. \\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/duringmerge.png}\\
\item You have a merge conflict between the two branches, because you modfied the same part of the file in both branches. You can use your text editor to choose the lines you want. But there is a better way..
\item Double click on the file which has the conflict. \\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/conflict_resolve2.png}\\
\item A new window opens which displays three times the same file. You have the two branches on the sides and the result in the middle. \\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/conflict_resolve3.png}\\
\item Use the "Take Left","Take right" or any of the other options to select what should be taken. You can also just write into the file in the middle. Click "save" afterwards.
\item Stage your changes and commit. Your branches should look like this now.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/merged.png}\\
\item First use your repo or make a new one and make 3-4 commits on the master branch. \\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/before.png}\\
\item Create branch (Branch $\rightarrow$ Add Branch). Depending on what you clicked after naming the branch, you are either still on master or are already on the new branch.\\
Make sure that you are on your new branch with (Branch $\rightarrow$ Check out $\rightarrow$ [name of your branch]) or simply click on the branch name in the bottom left corner.\\[5pt]
\includegraphics[width=0.6\linewidth]{Figs/tutorialPart2/checkoutbranch.png}\\
\item Edit a file and create a new commit on the new branch. Maybe 1-2 commits.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/addtofeaturebranch.png}\\
\item Checkout the master branch again via (Branch $\rightarrow$ Check out $\rightarrow$ [name of your branch]) or by clicking ''master'' in the bottom left-hand area.
All the changes from before are now gone (i.e. they are on the other branch). Click on the \textbf{tickmark} next to the branch name in the bottom left to make it visible.% \\[5pt]
%\includegraphics[width=\linewidth]{Figs/tutorialPart2/checkout_master.png}\\
\item Make 1 or 2 commits on the master branch.
\clearpage
\item Your branches should look like this now.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/branchbeforemerge.png}\\
\item Right click on your branch and select \textit{merge}. \\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/duringmerge.png}\\
\item You have a merge conflict between the two branches, because you modfied the same part of the file in both branches. You can use your text editor to choose the lines you want. But there is a better way..
\item Double click on the file which has the conflict. \\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/conflict_resolve2.png}\\
\item A new window opens which displays different versions of the same file; the two branches on the sides and the result in the middle. \\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/conflict_resolve3.png}\\
\item Use the "Take Left","Take right" or any of the other options to select what should be retained in the result.
You can also make edits to the file in the middle by typing.
Click "save" in the top-left of the toolbar afterwards.
\clearpage
\item Stage your changes and commit. Your branches should look like this now.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/merged.png}\\
\end{itemize}
Collaborative development. Now your partner becomes very useful, finally. You will learn now how to synchronize development with others. This builds heavily on branches and merging.
\textit{Collaborative development}. Now your partner becomes very useful, finally. You will learn now how to synchronize development with others. This builds heavily on branches and merging.
\hbadness=10000
\begin{itemize}
\item \textit{Create} a new group on GitLab \url{https://GitLab.tue.nl/}.Groups$\rightarrow$your Groups\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/createGroup.png}\\
Click on ''New group''.\\[5pt]
Groups are not necessary to work on a shared project. So you can also skip this step and add people directly to the project.
\item \textit{Add} yourself and your partner to the group \url{https://GitLab.tue.nl/}.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/addpeopletogroup.png}\\
Click on ''New group''.\\[5pt]
\item \textit{Create} a new repo on GitLab \url{https://GitLab.tue.nl/}.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/createproject.png}\\
Click on ''New project''.\\[5pt]
You can also use an old repository from earlier.
\item \textit{Create} a new repo on GitLab \url{https://GitLab.tue.nl/}.\\[5pt]
\item If you did not create a group you can add people to the project now.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/addpeopletoproject.png}\\
Click on ''New project''.\\[5pt]
\item Both clone the repository and make changes to the same file on your computer. Push the changes and see what happens.
\item One of you will not be able to push your changes. Pull the up to date version from the server and merge locally then push the changes to the server.
\item Instead you can also create your own branches push them to GitLab and then merge them into the main branch via a Merge Request. So you do not always have to merge before pushing to GitLab.
\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/merge_request_start.png}\\ [5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/merge_request_2.png}\\ [5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/submit_merge_request.png}\\ [5pt]
\item If you are bored create an issue for the project and assign your colleague.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/createIssue.png}\\
\item \textit{Create} a new group on GitLab \url{https://GitLab.tue.nl/} via
(Groups $\rightarrow$ your Groups).\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/createGroup.png}\\
Click on ''New group''.\\[5pt]
Groups are not necessary to work on a shared project. So you can also skip this step and add people directly to the project.
\item \textit{Add} yourself and your partner to the group \url{https://GitLab.tue.nl/}.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/addpeopletogroup.png}\\
Click on ''New group''.\\[5pt]
\item \textit{Create} a new repo on GitLab \url{https://GitLab.tue.nl/}.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/createproject.png}\\
Click on ''New project''.\\[5pt]
You can also use an old repository from earlier.
\item If you did not create a group you can add people to the project now.\\[5pt]
\includegraphics[width=0.85\linewidth]{Figs/tutorialPart2/addpeopletoproject.png}\\
Click on ''New project''.\\[5pt]
\item Both of you \textit{clone} the repository and \textbf{make changes to the same file on your computer}. \textit{Push} the changes and see what happens.
\item One of you will not be able to push your changes. Pull the up to date version from the server and solve the merge conflict locally, then push the changes to the server.
\item An alternative way to work is to create your own branches, then push them to GitLab and merge them into the main branch via a \text{Merge Request}.
This way, you do not always have to merge before pushing to GitLab.
\\[5pt]
\includegraphics[width=0.9\linewidth]{Figs/tutorialPart2/merge_request_start.png}\\ [5pt]
\includegraphics[width=0.9\linewidth]{Figs/tutorialPart2/merge_request_2.png}\\ [5pt]
\includegraphics[width=0.9\linewidth]{Figs/tutorialPart2/submit_merge_request.png}\\ [5pt]
\item If you are bored, create an \textit{issue} for the project and assign your colleague.\\[5pt]
\includegraphics[width=\linewidth]{Figs/tutorialPart2/createIssue.png}\\
\end{itemize}
Tips on good practices
Finally, we have some tips for good practices:
\begin{itemize}
\item Always use instructive commit messages!
\item Only put source files under version control, i.e. the .tex and .bib files not the .aux .log and certainly not the .pdf
\item Only put source files under version control, i.e. the .tex and .bib files not the .aux .log and certainly not the .pdf!
\item Make many small commits instead of one large one!
\item Do not push or commit to master, make a separate branch and make a merge request. It is much kinder to others you work with.
\item Do not push or commit to master, make a separate branch and make a merge request. It is much kinder to others you work with.
\end{itemize}
......
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