Table of Contents
One of git, one of git detailed explanations
Home Backend Development PHP Tutorial git one, git detailed explanation one_PHP tutorial

git one, git detailed explanation one_PHP tutorial

Jul 12, 2016 am 08:56 AM
git

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
Copy after login

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"
Copy after login


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 of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1268
29
C# Tutorial
1242
24
How to download git projects to local How to download git projects to local Apr 17, 2025 pm 04:36 PM

To download projects locally via Git, follow these steps: Install Git. Navigate to the project directory. cloning the remote repository using the following command: git clone https://github.com/username/repository-name.git

How to update code in git How to update code in git Apr 17, 2025 pm 04:45 PM

Steps to update git code: Check out code: git clone https://github.com/username/repo.git Get the latest changes: git fetch merge changes: git merge origin/master push changes (optional): git push origin master

How to merge code in git How to merge code in git Apr 17, 2025 pm 04:39 PM

Git code merge process: Pull the latest changes to avoid conflicts. Switch to the branch you want to merge. Initiate a merge, specifying the branch to merge. Resolve merge conflicts (if any). Staging and commit merge, providing commit message.

How to use git commit How to use git commit Apr 17, 2025 pm 03:57 PM

Git Commit is a command that records file changes to a Git repository to save a snapshot of the current state of the project. How to use it is as follows: Add changes to the temporary storage area Write a concise and informative submission message to save and exit the submission message to complete the submission optionally: Add a signature for the submission Use git log to view the submission content

What to do if the git download is not active What to do if the git download is not active Apr 17, 2025 pm 04:54 PM

Resolve: When Git download speed is slow, you can take the following steps: Check the network connection and try to switch the connection method. Optimize Git configuration: Increase the POST buffer size (git config --global http.postBuffer 524288000), and reduce the low-speed limit (git config --global http.lowSpeedLimit 1000). Use a Git proxy (such as git-proxy or git-lfs-proxy). Try using a different Git client (such as Sourcetree or Github Desktop). Check for fire protection

How to solve the efficient search problem in PHP projects? Typesense helps you achieve it! How to solve the efficient search problem in PHP projects? Typesense helps you achieve it! Apr 17, 2025 pm 08:15 PM

When developing an e-commerce website, I encountered a difficult problem: How to achieve efficient search functions in large amounts of product data? Traditional database searches are inefficient and have poor user experience. After some research, I discovered the search engine Typesense and solved this problem through its official PHP client typesense/typesense-php, which greatly improved the search performance.

How to delete a repository by git How to delete a repository by git Apr 17, 2025 pm 04:03 PM

To delete a Git repository, follow these steps: Confirm the repository you want to delete. Local deletion of repository: Use the rm -rf command to delete its folder. Remotely delete a warehouse: Navigate to the warehouse settings, find the "Delete Warehouse" option, and confirm the operation.

How to update local code in git How to update local code in git Apr 17, 2025 pm 04:48 PM

How to update local Git code? Use git fetch to pull the latest changes from the remote repository. Merge remote changes to the local branch using git merge origin/&lt;remote branch name&gt;. Resolve conflicts arising from mergers. Use git commit -m "Merge branch &lt;Remote branch name&gt;" to submit merge changes and apply updates.

See all articles