Overviewing Git and its command lines

To understand the origin of Git, it is necessary to know that there are two types of VCS: centralized and distributed systems.

The first type to emerge is the centralized systems, such as SVN, CVS, Subversion, and TFVC (or SourceSafe). These systems consist of a remote server that centralizes the code of all developers.

We can represent a source centralized system like this:

All developers can archive and retrieve their code on the remote server. The system allows better collaboration between teams and a guarantee of code backup. However, it has its drawbacks:

  • In case of no connection (for a network problem or internet disconnection) between the developers and the remote server, no more archiving or code recovery actions can be performed.
  • If the remote server no longer works, the code, as well as the history, will be lost.

The second type of CVS, which appeared later, is a distributed system, such as Mercurial or Git. These systems consist of a remote repository and a local copy of this repository on each developer's local machine, as shown in the following schema:

So, with this distributed system, even in the event of disconnection from the remote repository, the developer can continue to work with the local repository, and synchronization will be done when the remote repository is accessible again. And on the other hand, a copy of the code and its history is also present in the local repository.

Git is, therefore, a distributed CVS that was created in 2005 by Linus Torvalds and the Linux development community.


To learn a little more about Git's history, read this page: https://git-scm.com/book/en/v2/Getting-Started-A-Short-History-of-Git.

Since its creation, Git has become a very powerful and mature tool that can be used by anyone for coding. 

Git is a free, cross-platform tool, and it can be installed on a local machine for people who manipulate code, that is, in client mode, but can also be installed on servers to host and manage remote repositories.

Git is a command-line tool with a multitude of options. Nevertheless, today there are many graphical tools, such as Git GUI, Git Kraken, GitHub desktop, or SourceTree, that allow you to interact with Git operations more easily and graphically without having to use command lines yourself. However, these graphical tools do not contain all of the operations and options available on the command line. Fortunately, many code editors such as Visual Studio Code, Visual Studio, JetBrains, and SublimeText allow direct code integration with Git and remote repositories.

For remote repositories, there are several clouds and free solutions such as GitHub, GitLab, Azure DevOps, or Bitbucket cloud. Also, there are other solutions called on-premises, which can be installed in an enterprise, such as Azure DevOps Server, Bitbucket, or GitHub Enterprise.

In this chapter, we will see the usage of Git, for example, with Azure DevOps as a remote repository, and we will see the use of GitLab and GitHub in future chapters.

In this section, we have introduced Git, and we will now see how to install it on a local machine to develop and version our sources.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.108.11