Git, GitHub and GitLab

What is the Git system and why has it become popular?

Git is a version control system designed for software developers. With its help, they can track and control all the changes they make to the project’s code base.

The main structural element in the Git system is called a repository. It is a separate directory on a remote server that stores all files for a specific project: code, images, audio, video, documentation, etc.

A copy of a repository hosted on a local server is called a branch and is intended for isolated development. If desired, developers can merge their branch with other branches or add it to the central repository by creating a pull request.

It is important that any, even the most minimal change is committed to Git separately, and not overwritten. Therefore, the version control system allows you to restore already changed or erased code, acting similarly to backup systems.

Thanks to her, each project participant sees all the changes made by his colleagues, as well as who exactly made them.

Git was developed by Linus Torvalds (creator of the Linux operating system) in 2005 to simplify and streamline collaboration on software development projects. With this tool, developers can work effectively on a common project, make and save changes, and observe each other’s work.

As for the advantages of the Git system, the following facts can be noted among them:

Data is stored in it as snapshots of the file system. Each time you save a project, the system remembers the state of all files and generates a link to this snapshot. While other VCSs store data in change list format.

It is a completely free and open-source tool that provides unlimited possibilities for refinement and modification.
Ideal for creating backups, minimizing the risk of deleting or rewriting program code.

It has a simple and understandable branch management system, which makes it much more convenient than other hard currency systems with complex branching.
All operations in it are performed locally, which significantly increases the speed of data processing.

The repository is saved here in a small file size, without any reduction in data quality.

What is GitHub, what are its features, and how is it different from Git?

GitHub is an online repository hosting service. It is a cloud storage of files on a remote server, where all new and changed versions of the program code are stored.

Thus, if Git is a tool, then GitHub is a service that allows you to use this tool. It is considered the largest and most well-known platform on the Internet for hosting and collaborating on IT projects.

GitHub was designed specifically for Git, so it has features such as:

  • All functions of the distributed version control system and flexible options for source code management;
  • Access control system, capabilities for managing tasks and maintaining wiki pages for projects, bug tracking options;
  • Access to repositories through the internal interface, command line and Git commands;
  • Documentation, commit history, email notifications, pull requests, user mentions and graphics;
  • Creating a fork (copy) of a remote repository on the GitHub server and interactive preparation (managing the area of ​​prepared files).

With its help, they can communicate with their colleagues and like-minded people, follow their own and third-party projects, comment on the code of other participants and share their experience. The service is available free of charge for open source projects, and there is also a line of paid tariff plans for corporate clients.

GitLab is a growing alternative to GitHub

GitLab is another well-known online service for storing and working with git repositories. It is based on a database system, which makes installing GitLab a little more difficult, but detailed instructions will help to solve possible problems for users.

The repository of GitLab repositories can be deployed both in the cloud through the official website of the project, and on a local server.

There are several options for installing a database: through the Omnibus GitLab installation package, from source files, using a cloud provider (Google Cloud Platform, AWS, OpenShift, Azure, etc.) and a number of other methods.

GitLab was launched three years later than GitHub, so the number of its users is still less than that of the “hub”. Despite this, more than 100,000 projects, companies and organizations use the service, including such global corporations as IBM, Sony, Alibaba, NASA, CERN and many others.

As for the functionality of GitLab, it provides the following features:

  • Creation, storage and management of public and private repositories;
  • Organization of sharing access to repositories, regulation of access rights of users and groups;
  • Integration with CI systems (Jenkins, etc.);
  • Tracking changes, comments on projects, creating wiki pages, idea and task boards, integration with third-party software via API, etc.;
  • Authentication and authorization tools, performance analytics and issue tracking, error monitoring and time management, source code management and web-based editing console, continuous integration (CI) support, code testing and quality assurance, repository and container management, vulnerability management and scanning dependencies.

GitLab offers two free versions: Community Edition for small teams or personal projects (deployed on the user’s local server) and a free cloud version created on a remote hosting server (storage up to 10 GB). Two paid versions are also available here: the basic Enterprise Edition Starter and the extended Enterprise Edition Premium.

Bitbucket is another popular tool

Bitbucket is a popular online project hosting and collaborative development service based on Git and Mercurial version control systems. It is part of Atlassian’s products and provides developers with a single space to plan, develop, test, and deploy projects.

Bitbucket allows you to store an unlimited amount of non-public repositories for free for small teams (up to 5 members) and offers a number of paid plans for larger teams.

It provides extensive integrations with Jira, Trello and other Atlassian products, a suite of DevOps tools, and continuous integration and delivery (CI/CD) functionality with built-in Bitbucket Pipelines.

Other advantages of Bitbucket include enterprise-grade advanced security tools (IP allow lists, two-factor authentication, etc.) and the option to manage access rights for individual project branches.

Important developer tools

One of the most popular tools for software developers is the Git version control system. It helps to place program code and other project data in special storage repositories on local or remote servers, providing ample opportunities for collaboration on them.

The most famous and popular repository hosting service is GitHub, which allows you to create projects with the maximum number of participants. Also, a similar online hosting GitLab is gaining more and more popularity, which has a number of advantages in the field of continuous integration, data protection and security.

As a member of a documentation project, you will use a number of tools and processes. You will work in parallel with other members on the same project, sometimes on the same content at the same time. All of this is possible thanks to Git and GitHub software.

Git is an open source version control system. It makes it easy to collaborate on these types of projects by using a distributed version control system for files stored in repositories.

Essentially, Git allows you to integrate workflows performed by multiple contributors over a period of time into a specific repository.

GitHub is a web hosting service for Git repositories that are used to store the content of docs.microsoft.com. GitHub hosts the main repository of all projects. From this repository, contributors copy their work.

If you’re familiar with centralized version control systems (such as Team Foundation Server, SharePoint, or Visual SourceSafe), you’ll notice that Git uses a unique workflow and specialized terminology to support the distributed model.

For example, Git does not lock files, as is usually the case when a file is checked in or checked in after editing. In fact, Git takes changes into account at a more subtle level, comparing files byte by byte.

Git also uses a layered structure to store and manage project content.

A repository is the highest level storage unit. A repository contains one or more branches.
A branch is a unit of storage with current files and folders that form the contents of a project. Branches are used to separate workflows (commonly referred to as versions).

Contributors always make changes to content in a particular branch, and those changes are tied to that branch. All repositories contain a default branch (usually called “main”) and one or more branches to be merged into the default branch.

The default branch is the current version and the “only true source” for a particular project. From this parent branch, all other branches in the repository are created.
Members interact with Git to update and manage repositories locally and at the GitHub level.

For local collaboration, participants use tools such as the Git Bash console, which supports Git commands for managing local repositories and communicating with GitHub repositories.

In addition, contributors use the Git-integrated site www.github.com to manage the reconciliation of changes pushed back to the main repository.

Catalog organization

As mentioned earlier, the default branch acts as the current version of the project’s content. The contents of the default branch (and the branches created from it) roughly follow the structure of the articles on the corresponding documentation pages.

Subdirectories are used to separate content (such as services), multimedia content (such as image files), and include files that allow content to be reused.

The main articles directory is usually located at the root of the repository. This article directory contains a set of subdirectories. Articles in subdirectories are formatted as Markdown files using the .md extension.

Some repositories that support multiple services, such as the Azure-Docs repository, use the /articles generic subdirectory. Other repositories, such as IntuneDocs, use a subdirectory named as a service: /IntuneDocs.

At the root of this directory are general articles that describe the service or product as a whole. Typically, the directory contains another series of subdirectories that correspond to features and services or common scenarios.

For example, articles that describe the Azure Virtual Machine Service are located in the /virtual-machines subdirectory, and Intune Explore articles are located in the /understand-explore subdirectory.

Subdirectory Media

Each directory contains a /media subdirectory for the corresponding media files. Media files contain images used in articles with links to images.

subdirectory includes
Reusable content that is shared between two or more articles is placed in the /includes subdirectory of the main articles directory.

.In a Markdown file that uses an include file, the appropriate Markdown include extension is placed at the location that the include file reference should point to.

For more guidance, see Markdown Reference – Include Files.

Markdown File Template

For convenience, in the root directory of each repository, there is usually a Markdown template file named template.md.

It can be used as an initial file for creating an article and then submitting it to the repository. The file contains the following components.

The metadata header at the top of the file, separated by two lines with three dashes. It contains various tags used to keep track of information related to the article.

Article metadata provides additional functionality. For example, you can specify links to the author and contributor, customize the navigation bar, add a description of the article.

They also include the search engine optimization and reporting processes that Microsoft uses to measure the performance of content. As you can see, metadata matters a lot.

Metadata section describing various metadata tags and values. If you don’t know what values ​​to use for the metadata section, you can leave them blank or comment them out with a leading hashtag (#). This is how the pull request reviewer in the repository can review or execute them.

Various examples of using Markdown markup to format article elements.
General instructions for using Markdown markup extensions that can be applied to different types of alerts.

Examples of embedding videos using iframe

General instructions for using docs.microsoft.com extensions that can be applied to special controls such as buttons and selectors.

Pull requests

Pull Request – Using this convenient method, a contributor proposes a set of changes to be pushed to the standard branch. Changes (also called commits) are stored in the member’s branch.

GitHub uses them to model the results of merging them into the standard branch. A pull request also serves as a mechanism for providing the contributor with the reviewer’s feedback on the request.

The reviewer sends feedback to the contributor after the build and review process to resolve potential issues or issues before the changes are merged into the standard branch.

There are two ways to work with a pull request, depending on the size of the changes you want to propose. For more information, see Workflow for GitHub contributors: Minor or episodic changes.