What is Git ?
By: Somboon Yeesaeng
Tags: Git

Git is a Distributed Version Control. It is a system that can be used to store and control changes made to any type of file, be it Text File or Binary File (hereinafter referred to as Text File or Binary File as Source Code).

Why should I use Git?

Track version of Source Code can be reversed.

When files are stored in Git’s system, it is called the Git Repository, which stores backups and source code changes, allowing it to go back to any previous version and view the changes to each version. Besides that, you can also see who edited it !!

It helps in developing software as a team.

Git can save the latest version of Source Code changes in the local repository, which can work without internet connection and when need to update the latest version of Source Code to teammates, it can be pushed up to the archive. At Remote Repository (Git Hosting), and teammates can pull the latest version to include (Auto Merge) on his own machine, keeping the Source Code developed together with the team members always up to date.

Git Status

The state of the Source Code stored in Git’s system is as follows:

Untracked is the state in which Source Code was newly added and is not stored in Git.

is the state in which Source Code was newly added and is not stored in Git. Working Directory is a state where Source Code is being changed or modified, or it may be called Modified.

is a state where Source Code is being changed or modified, or it may be called Modified. Staged is a state where Source Code is preparing to commit to confirm changes before they are put into Local Repository state.

is a state where Source Code is preparing to commit to confirm changes before they are put into Local Repository state. Local Repository is the state in which source code changes are saved to the Local Git Repository (on the machine itself).

is the state in which source code changes are saved to the Local Git Repository (on the machine itself). Remote Repository is a state in which source code changes are saved to the Git Repository hosting (on the server).

How does Git work?

Actually, it is a Distributed Version Control Systems (if you want to know more details, you can use this keyword to find more information).

Try to imagine that there is a central server that keeps data from each user first.

The central server, I call it Remote 1. The developers who are doing this project are called Computer 1 and 2, each of them doing a different feature, each feature is stored at Remote 1.

It may seem that it is a central server system that keeps backing up everyone’s data all the time. But in reality, there is a lot more to Git.

Git is designed to run decentralized distribution. Any machine can work as a VCS by itself.

This means that there is no need to have a central server. You can use a personal machine as a VCS.

This will make our data not too monopoly on the Server when the Central Server has a problem or that works Offline, we still work. Using information from the VCS within the machine itself Once connected to the central server, you can sync the data later.

And when every machine is already working as a VCS, we can have more than 1 central server as well. (But rarely encountered this kind of use)

Git only syncs data when we order.

Git syncing steps will be discussed later. Let’s focus on the overview of the work first.

When we want to Sync data from the Remote to the device or from the device sent up to the Remote, it has to be a manageable person, not Sync automatically. Because there will be a lot of troubles that we have to make decisions and make choices. Can’t have Git do it automatically.

For example Code from 2 developers pushing to edit on the same line. But the order is different And the purpose of the code are different, so how does Git get to know what kind of code to use?

And that is the job of the developers to decide or modify the code itself, the person who Sync data on Remote first will not have to do anything and the person who Sync later will have to do it. Which can decide which person to use the code of the first Or use your own code Or you can edit the code to accommodate both people’s code.

So Git is not completely automated. Because there are many subtleties that users like us need to understand in order to properly handle the code in the project.

Conclude

I must say that Git has changed the lives of developers for the better. Solve the same problems in Development Process that have been a headache for a long time, become easy Anything will be organized and organized. Problems arise, so you can know why and who skills.

And most importantly, the world of developers can Open Source each other today. Partly thanks to Git that made it easy. Even though it has been VCS for a long time, it’s true. But with the popularity of Git and GitHub, it has widespread open source community.

REFERANCE