Home >Backend Development >PHP Tutorial >git one, git detailed explanation one_PHP tutorial

git one, git detailed explanation one_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 08:56:39853browse

One of git, one of git detailed explanations

1. What is Git
Git is a Free, open source, distributed version control system for agile and efficient handling of any project, small or large.

Git is an open source distributed version control system that is used to effectively and quickly handle version management of projects from small to very large projects. Git is an open source version control software developed by Linus Torvalds to help manage Linux kernel development.

2. Git features
The biggest difference between distributed and centralized is that developers can submit to local , every A developer copies a complete Git repository on the local machine by cloning (git clone).

1) Record snapshots directly instead of comparing differences: Git is more like taking a snapshot of the changed files and recording them in a miniature file system.
2) Almost all operations are performed locally: Most operations in Git only require access to local files and resources, without being connected to the Internet.
3) Maintain data integrity at all times: Before saving to Git, all data must undergo content checksum calculation, and this result will be used as the unique identification and index of the data.
4) Most operations only add data: Most common Git operations just add data to the database.

3. Centralized version control
CVS and SVN are both centralized version control systems, while Git is a distributed version control system.

Centralized version control system, the version library is stored in a central server. People working together need to use their own computers to synchronize updates or upload their own changes from the server.
However, all version data is stored on the server, and the user’s local device only has the version it has synced before. If it is not connected to the Internet, the user cannot see the historical version and cannot switch. Version verification issues, or working on different branches. .

Moreover, all data is saved on a single server. There is a great risk that this server will be damaged, and all data will be lost. Of course, regular backups can be made.

4. Distributed version control
What is the difference between a distributed version control system and a centralized version control system?

The distributed version control system does not have a "central server" at all. Everyone's computer has a complete version library and does not require an Internet connection to work. Since everyone has a complete version library on their computer, how can multiple people collaborate? For example, if you and a colleague modify the same file on separate computers, you only need to push your modifications to each other, and then you can see each other's modifications.

The security of a distributed version control system is much higher because everyone has a complete version library on their computer. Everyone can copy each other.

Distributed version control systems usually also have a computer that acts as a "central server", but the role of this server is only to facilitate the "exchange" of everyone's modifications. Without it, everyone can still work, just exchange It’s just inconvenient to modify.

5. Install Git
Git was first developed on Linux. For a long time, Git could only be used on Linux and Unix systems. run. However, slowly someone ported it to Windows. Now, Git can run normally on the major platforms of Linux, Unix, Mac and Windows.

Install Git on Linux:

First, you can try typing git to see if Git is installed on the system:

<span>1</span> $ git

Like the above command, many Linux systems will kindly tell you that Git is not installed, and will also tell you how to install Git.

If you happen to use Debian or Ubuntu Linux, you can directly install Git through sudo apt-get install git, which is very simple. If you want to check whether the installation is successful, pass git --version.

If it is another Linux version, you can install it directly from the source code. First download the source code from the Git official website, then unzip it, and enter these commands in order: ./config, make, sudo make install to install it.

After the installation is completed, the final step of setting is required. Enter on the command line:

<span>1</span> $ git config --global user.name "Your Name"
2 $ git config --global user.email "email@example.com"


Because Git is a distributed version control system, each machine must report itself: your name and email address.

Pay attention to the --global parameter of the git config command. Using this parameter means that all Git repositories on your machine will use this configuration , of course. You can specify different usernames and email addresses for a certain warehouse.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1111692.htmlTechArticlegit one, git detailed explanation one 1. What is Git Git is a free, open source distributed version Control systems for handling any project, small or large, with agility and efficiency. Git is an open source...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn