-
Karo Saharinen authoredKaro Saharinen authored
Generally on Git, Markdown, Gitlab, Github
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:
Markdown
On the course we will use the Markdown writing format.
Markdown is a convenient file/writing format, because:
- Writing is simple
- 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).
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.
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.
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.
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.
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.
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.
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
The menu of how to make a new issue is brought up.