Skip to content
Snippets Groups Projects
Commit 88a604dd authored by Karo Saharinen's avatar Karo Saharinen
Browse files

Initial release 2021

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 331 additions and 0 deletions
# Git version control ja Gitlab project management environment - TTZW0410 - 1 ECTS
On this course we study how Git version control and Gitlab project/repository management environment are used. Git has become the 'de facto' tool for source code version control and these practices can be used on any field of education.
This material has mostly been made in 2018 with slight updates in the August of 2020. Video's have been renewed for the english language implementation in 2021.
:movie_camera: [Course Introduction video](https://panopto.jamk.fi/Panopto/Pages/Viewer.aspx?id=80bc5aa0-20a9-4642-af31-ad890040aaa4) :movie_camera:
1. [Generally](#generally)
3. [Timetable](#timetable)
2. [Material](#material)
2. [Literature](#literature)
2. [Evaluation](#evaluation)
4. [Other](#other)
## Generally
![JAMK Institute of Information Technology](src/jamk_it-instituutti_logo_engl_web_350x150.png "JAMK IT-instituutti")
| - | JAMK, Unit of Technology, Institute of Information Technology |
|:--------|:----------:|
| Teacher | [Karo Saharinen](https://www.linkedin.com/in/karo-saharinen) - karo.saharinen@jamk.fi - [D571](https://www.jamk.fi/fi/Yhteystiedot/Lutakon-kampus/) |
| Semester | Nonstop |
| Group | Any degree programme |
The objectives and pre-requisites for the course you can read from [the course description in Peppi](https://opetussuunnitelmat.peppi.jamk.fi/en/TTV2020SS/course_unit/TTZW0410). Recognition of Prior Learning (RPL) process can be done according to [JAMK's instructions](https://studyguide.jamk.fi/en/study-guide-bachelors-degrees/studying-at-jamk/recognition-of-prior-learning-and-experience/).
## Timetable
The recommended order of studying is presented below.
| Week | Material | Assignments |
|:--------|:----------:|---------|
| 01 | [Generally Git & Gitlab, Issues ja Milestones](src/vko/vko01.md) | [Assignment 1](src/vko/vko01_harj.md) |
| 02 | [Git installation, Git basics & Markdown file formatting](src/vko/vko02.md) | [Assignment 2](src/vko/vko02_harj.md) |
| 03 | [Git HTTPS/SSH, Revision history, Diff -info, Statistics & Wiki](src/vko/vko03.md) | [Assignment 3](src/vko/vko03_harj.md) |
| 04 | [Pandoc, binary files, .gitignore, draw.io and CI/CD pipelines](src/vko/vko04.md) | [Assignment 4](src/vko/vko04_harj.md) |
| 05 | [Branches, Merge Requests, Merge Conflicts and finally repository settings](src/vko/vko05.md) | [Assignment 5](src/vko/vko05_harj.md) |
### Students of JAMK
The course can be found from the study plan of Information and Communications Technology (TIC) students as a elective course. The course is ran as an nonstop implementation, which means you can start the course immediately by enrolling in [Peppi](https://peppi.jamk.fi) for the course:
:scroll: [https://peppi.jamk.fi](https://peppi.jamk.fi) -> Studies -> PLP -> Enrollments -> Search for courses -> Write: "gitlab" and press Search -> Enroll :scroll:
If necessary you can resort to [Peppi student guide.](https://oppimateriaalit.jamk.fi/peppi/en/studies/enrollment-for-course-implementations/)
### Students of CampusOnline
The course is opened separately for autumn and spring semesters. Enroll according to CampusOnline instructions.
## Material
The study material is distributed through:
- Gitlab repository export file, which can be downloaded from the [Moodle -workspace](https://moodle.jamk.fi). The file includes used material and source references.
Discussions and virtual support:
- Login with your @student.jamk.fi -account to [Microsoft Teams](https://teams.microsoft.com) and join a open team `TTZW0410 Git -versionhallinta ja Gitlab -projektien hallintaympäristö` (sorry for the finnish name, you can discuss in english also)
- You can also send email, if necessary to karo.saharinen@jamk.fi
### Instructions for starting the course
The study material is distributed through:
- Gitlab repository export file, which can be downloaded from the [Moodle -workspace](https://moodle.jamk.fi). The file includes used material and source references.
The course can be done either in:
1. https://gitlab.labranet.jamk.fi -server (JAMK LabraNet student/account), :movie_camera: [video of the login](https://panopto.jamk.fi/Panopto/Pages/Viewer.aspx?id=59a00c6d-66b7-47a2-821f-ad890040ab07) :movie_camera:
2. https://gitlab.com -server, :movie_camera: [video of the login](https://panopto.jamk.fi/Panopto/Pages/Viewer.aspx?id=a611e2ca-7ecc-4bb6-8028-ad8700716635) :movie_camera:
:exclamation: After the login/register you have to bring/import the exported repository file into Gitlab. I won't be sending this file as an email as the link is in [Moodle](https://moodle.jamk.fi). Look at the instruction :movie_camera: [video](https://panopto.jamk.fi/Panopto/Pages/Viewer.aspx?id=59a00c6d-66b7-47a2-821f-ad890040ab07). :movie_camera:
## Literature
[Chacon, S. & Straub, B. 2014. Pro Git.](https://github.com/progit/progit2/releases/download/2.1.241/progit.pdf)
## Evaluation
On the course the student returns:
- **1 ECTS:** Student does all the necessary assignments and afterwards adds @sahka as a member of the repository (with Maintainer -rights). This is the last assignment of the last assignment.
The returned repositories are evaluated as Passed / Not Passed.
## Other
There is no mandatory attendance requirements.
Course feedback is asked in the last assignment.
## License
This course and its materials are written by [Karo Saharinen](https://www.linkedin.com/in/karo-saharinen/) and licenced by [Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) ](http://creativecommons.org/licenses/by-nc-nd/4.0/) -license.
[![Creative Commons -licence](/images/cc.png)](http://creativecommons.org/licenses/by-nc-nd/4.0/)
src/jamk_it-instituutti_logo_engl_web_350x150.png

16.1 KiB

src/pics/centralized.png

102 KiB

src/pics/distributed.png

114 KiB

src/pics/local.png

109 KiB

[Back to the beginning](README.md)
# Generally on Git, Markdown, Gitlab, Github
:movie_camera: [Lecture Video](https://panopto.jamk.fi/Panopto/Pages/Viewer.aspx?id=310df793-72c3-4933-b345-ad890040aae1) :movie_camera:
## Git and version control
Version control in projects is still a difficult thing.
Different projects are called (in Git language) as "repositories". In the slang of the IT field this repository/project term is often mixed.
Git -tool was formed from the need of the Linux Kernel -community to get a distributed version control system for source code tracking. After this, Git has developed to encompass a lot of other things, but its bases is still strongly in source code tracking.
Few recommended videos about the motivation to create Git:
- [Linus Torvalds interview of Git](https://www.youtube.com/watch?v=o8NPllzkFhE&feature=youtu.be&t=433)
- [Linus Torvalds speech on Git](https://www.youtube.com/watch?v=4XpnKHJAok8)
## Markdown
On the course we will use the Markdown writing format.
Markdown is a convenient file/writing format, because:
1. Writing is simple
2. It is the basic file format for different Git -development environments to create web pages
This whole course has been written in the Markdown -format.
## Gitxyz -development environment
Development environments bring other functionalities around git. E.g. Issue Tracker and Continuous Integration -chains (Note! You don't have to understand them at this point).
These development environments give the basic user its most valuable asset in controlling the repository: the web browser (front end). In theory you do not even have to use the command-line interface, if you do not wish to do so. On this course we use the command-line interface to understand the technical functionality of the git version control.
### Gitlab
Gitlab is an open source Git repository management software. It also includes a bunch of handy features.
On this course we use Gitlab (rather than Github), because it can be (if necessary) installed locally on a virtual machine. You can separately control the entire Git -environment. This is how you understand the technical functionality of Git.
### Github
Github is more popular than Gitlab (and older) management software. Github can be called the 'social media of programmers', in which you can follow the projects/repositories of your favourite programmers. The Github profile page has developed into a "CV" of programmers.
Github can be used with the learning outcomes of this course, but you cannot install a local virtual machine of Github. It is left for the student to decide which product they might choose to use later on in their (coding) projects.
Usually the exporting and importing of repositories out of one environment to another is painless. There are of course some features of each individual management system that might have valuable information to you and might be left behind.
# Version Control
Version control follows the changes in a file (or multiple files) over a time span. This time could be for example the lifespan of a project.
## Local Version Control System
At its simplest form the version control system could be utilized in local files (or local hard drive).
![Local](src/pics/local.png "local")
We might for example have a folder **C:/HomeAssignments/**. This folder might then include files such as:
- Assignment_v01.docx
- Assignment_v02.docx
- Assignment_v03.docx
It is a failry simple structure, but effective. Unfortunately us humans are very irregular people and we usually make mistakes. Also the distribution of the folder is a cumbersome task. Email could be one way of sending version back and forth, but changes made are dependant on the file formating and its support for multiple users (and their version control).
On the video below i'm working with two different virtual machines: Windows 10 ja Ubuntu. Noticeable is that the changes on another computers local harddrive aren't seen on the other computer.
![localharddrive.webm](http://student.labranet.jamk.fi/~sahka/taustamateriaali/paikallinen.webm)
The files have to moved by an USB -stick, email or by some other transferrable media.
## Centralized Version Control System
Next step is towards a centralized version control (Version Control System - VCS) such as network drives (or cloud services as you now might know them). A certain Group has been given writing permissions on a network drive (or a cloud service folder). Still the changes made, naming and such are hard things. Very likely a few different people do different judgements in the same folder.
Also a centralized version control has the problem of collaboration. Also it is a "Single Point of Failure", because if the network drive (or network connectivity) fails. No one can work on the files.
![Centralized](src/pics/centralized.png "Centralized")
On the next video I am using LabraNet:s network disk service under `//ghost.labranet.jamk.fi/temp/verkkolevy` -folder. Notice that both of the computers can see the same network drive (on the server), thus changes can be seen by both. There are conflicting situations, if both are working on the same file.
![networkdrive.webm](http://student.labranet.jamk.fi/~sahka/taustamateriaali/verkkolevy.webm)
How network drives handle these race situations concerning locking/writing on files is a subject outside of this course.
## Distributed Version Control System
Distributed Version Control System ... distributes the files to all the users. Each of them have a copy of the files, but the server also contains those files. It would be preferrable that changes made to your own files should be uploaded to the centralized server once in a while. This distribution of working mandates a few steps when you work, but **Git** does these steps controllable.
![Distributed](src/pics/distributed.png "Distributed")
The hard part is to get people learn how the **Git** -tool works and how to take those necessary steps. When the student learns (or masters) of the benefits of **Git**, they usually start to demand it in several projects that they do (e.g. school assignments).
On the video below I show the basics of git very quickly to demonstrate its effectiveness.
![git.webm](http://student.labranet.jamk.fi/~sahka/taustamateriaali/git.webm)
Note! The video takes a bit more time to create the repositories, but the version control addition per file starts to overtake the "nuisance" of using the commands eventually. In a short while you do not even notice the given commands.
Lähde: [Chacon, S. & Straub, B. 2014. Pro Git.](https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control)
# Issues & Milestones
On the course we start by getting to know the terms Issues and Milestones. These are utilized to have the course (project/repository) its objectives for the duration of the course.
## Issues
Issue term has a hard time translating to Finnish. Its concept in repositories is also very varying.
An Issue is a bug, problem or an assignment. It is used to express a problem in the source code or inform an idea to the project. It can be also used to document unfinished work in the repository.
On this course we use the Issues to represent unfinished assignments.
### Lets Create an Issue
Use your browser to access: https://gitlab.labranet.jamk.fi -> Login -> Your Projects -> gitlab-course -> on the right Issues
![image](src/vko/vko01/issues1.png)
The menu of how to make a new issue is brought up.
![image](src/vko/vko01/issues2.png)
Here are the explainations field by field:
- **Title**, a descriptive text of the problem/fault/error/assignment/... as a short sentence e.g. "Finish the course"
- **Description**, contains a wider explaination than the title
- "Return your repository by adding @sahka / Karo Saharinen as a member of the project. Remember to fill the course feedback!"
- **Assignee**, Person who should solve the issue... This comes from the repository/project members and probably your account is the only one who can finish this issue.
- **Due Date**, It would be ideal if this issue could be solved before this due date... Give yourself a goal when you would wish the course to be over!
- **Milestone**, Project hasn't got any Milestones (if you follow my steps), thus this field can be only added later on
- **Labels**, A Project might have many Issues and you can label them any way you want with this field
- Lets label this issue as an "Assignment" (Create Label -> Name new label: Assignment -> Choose Color -> Press Create -> Choose from the dropdown -menu the created Assignment -label)
- **Weight**, Issue 'weight' between 1-9... the project can decide what weight is "the most important" (one or nine)
Once the fields are filled, the issue can be saved/sent to the project by Submit Issue. The figure below shows a filled Issue.
![image](src/vko/vko01/issues3.png)
And a ready made Issue after the submit button is pressed.
![image](src/vko/vko01/issues4.png)
You can comment more information on an issue if you wish. On the right you can also see additional parameters for it e.g.
- **Lock Issue**, only certain members can handle the issue
- **Confidentiality**, the issue visibility is reserved only for certain users
- **Time Tracking**, if you want to have an estimate of the time spent or report how long it took to handle
- Estimate of the timespent can be added by writing to the comment field e.g. "/estimate 3d 10h 5m"
- Reporting of how long it actually took e.g. "/spend 1h"
- These estimates/reports are very handy under the Milestones -section
On the top right you can see Issues assigned to my user account on all the repositories/projects I am working on.
![image](src/vko/vko01/issues5.png)
### Issue visualization
Issues can be visualized as a list under `Issues -> List`
![image](src/vko/vko01/issues6.png)
Or in the visualization of a board by selecting `Issues -> Boards`.
![image](src/vko/vko01/issues7.png)
A singular column/board (in the board view) is formed out of a label, thus the labels could be e.g.
- By functionality (e.g. [Kanban -model](https://www.atlassian.com/agile/kanban))
- **To-do**
- **In progress**
- **Code review**
- **Done**
Or
- By the form of doing
- **Read**
- **Do (Assignments)**
- **Return (Assignments)**
These Labels depend on the subject of the project. Below is an example board where the default **To do** and **Doing** labels.
![image](src/vko/vko01/issues8.png)
## Milestone
Issues can be categorized to different Milestones/Epics/Waypoints.
This is useful to dissect a larger project to smaller sprints (as the Agile world knows the phenomenon). Sprints are useful to dissect a software project to smaller parts where you can always publish a software after a sprint.
Milestones usually include a lot of Issues, that form a clear structure for the Milestone.
This course uses Milestones to include Assignments.
1. Milestone 1
- Issue 1 - Assignment 1
- Issue 2 - Assignment 2
- Issue 3 - Assignment 3
2. Milestone 2
- Issue 4 - Assignment 4
- Issue 5 - Assignment 5
Lets create one Milestone with the example above for concluding the course. Which contains the previosly created Issue.
![image](src/vko/vko01/milestones1.png)
A Milestone like this usually has a Start Date and Due Date. Also the Milestone can be described.
I set the milestone objective as the closing of the course, thus the last week of the 2018 semester.
![image](src/vko/vko01/milestones2.png)
The created milestone looks like this.
![image](src/vko/vko01/milestones3.png)
Now the milestone should include Issues, so lets move to the earlier made Issue and attach it to a Milestone.
Issues -> List -> Finalizing the course -> Milestone -> Edit -> and from the dropdown menu: Opintojakson päättäminen
Issue is updated (after the selection) to look like this.
![image](src/vko/vko01/milestones4.png)
Issues -> Milestones -view gets a graph of the "readiness" of the Milestone. Unfortunately it is now 0%, because 0/1 Issues has been closed. :smile:
![image](src/vko/vko01/milestones5.png)
So to conclude, the Milestones are clear '(sub)sections' of the project that can be dissected into ... Milestones.
So our first Assignment is to :tada: dissect this course to Milestones and Issues :tada:
# [Do Assignment 1](src/vko/vko01_harj.md)
src/vko/vko01/issues1.png

45.2 KiB

src/vko/vko01/issues2.png

47 KiB

src/vko/vko01/issues3.png

34.1 KiB

src/vko/vko01/issues4.png

76.3 KiB

src/vko/vko01/issues5.png

4.56 KiB

src/vko/vko01/issues6.png

49.7 KiB

src/vko/vko01/issues7.png

39.5 KiB

src/vko/vko01/issues8.png

36.2 KiB

src/vko/vko01/milestones1.png

20.2 KiB

src/vko/vko01/milestones2.png

33.7 KiB

src/vko/vko01/milestones3.png

36.1 KiB

src/vko/vko01/milestones4.png

91.9 KiB

src/vko/vko01/milestones5.png

53.7 KiB

src/vko/vko01/milestones6.png

62 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment