⊗gtPmStGS 2 of 65 menu

Introduction to Git for Beginners

Let's see how the Git system works. This system takes most of the work on itself. It makes backups itself, while copying only the changes, not all the files. It allows you to easily switch between versions of the project, developing both the first and second versions in the same folder. It allows you to easily share changes with colleagues. It allows you to easily develop features in parallel, then merge them with the main project.

Let's learn Git terminology. The backup folder in Git is called repository. Technically, it does not store all the files, but just their changes. You can always restore files to any state based on the changes. And storing only the changes prevents the repository from growing rapidly in size.

When we want to save something to the backup folder, in Git terms it is called making a commit. In the commit we specify a comment to our save so that later we can easily track what we did and, if necessary, roll back.

For the situation when we want to work on a specific feature of the project in a separate copy of the project, branches were invented. Git allows you to switch between development branches, and Git will change files directly in the project folder. That is, when we switch from branch to branch, Git will remove some files and show others directly in the project folder.

Having worked on a feature in a separate branch, we can easily merge the finished code with our main branch. In this case, Git will track files that belong to different branches at the same time. And if the changes in them conflict, then during the merge, Git will point this out to us and ask us to resolve the conflict. Of course, Git will not resolve the code conflict for us, it will simply point it out. We will be able to correct the code and then merge.

Git allows you to make sure that the main repository of the project is stored on the Internet. There are special services for this, for example, GitHub. This means that all the developers of the project will send their changes to one place. And this place, thanks to its placement on the Internet, will always be available. Other developers will also be able to easily get changes by accessing this repository.

At the same time, the Internet is not needed for development at all. You can develop on your computer in a place without Internet: on a plane, on a train, at your dacha. And then, when connected to the Internet, upload your changes to the common repository.

In the following lessons, we will take a closer look at the basic concepts of the Git system and learn how to work with it. It is assumed that you already know how to work with the command line. If not, then first study the command line tutorial and only then move on to the next lessons.

English
БеларускаяDeutschEspañolFrançaisPortuguêsРусский
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline