GIT's use 2

Fundamental

Check principle

Git the underlying hash algorithm SHA-1 algorithm to verify the same document. In fact, the hash algorithm is an encryption algorithm, can be different sizes and forms of documents, and parsed into a unique encryption result a fixed length (provided by the hash algorithm is the same), and when the file changes slightly large hash value will change, and thus can check the file information is consistent.

Management mechanism

GIT is to manage files by way of a snapshot version, the version in the form of a linked list to store the files. That each submission, GIT will be packed into a snapshot, and will retain its index value, the original pointer to the new node. If the file has not changed, the new node will not output, but a pointer to the original node, but to leave a record.

Management 9.png

Branch Management

Branch increased

Just add a pointer, not a copy of the file (more efficient)

Branch Management .jpg

Branch switch

Switching the pointer

Branch Management 1.jpg

Version branch

Pointer moves essentially

Branch Management 2.jpg

Branches merge

Branch Management 3.jpg

GIT and remote connections GitHub

GitHub is a remote link library, it can be seen as a database, and GitHub GIT is developed for users to upload and manage their own project version control tool.

The basic steps:

To create a remote library

yuan1.jpg

Link Library

Surnamed

Easy to use many times later, each time does not need to be copied again

command

git remote add an alias to add alias address

git remote -v View aliases

effect

yuan2.jpg

yuan3.jpg

Push file

command

git push alias branch name

effect

yuan4.jpg

Clone file

command

Address git clone remote repository

effect

yuan5.jpg

Crawl File

pull = fetch + merge two compositions.

Generally larger files, first fetch download, then check ensure that no problems, and then merge merge files

command

Branch address of the remote repository git pull remote library

effect

yuan6.jpg

Version Conflict
condition

GitHub does not support the modification is not based on the latest version of push

Solution

First with pull down files crawl

The method for post processing branches to processing conflicts

yuan7.jpg

yuan8.jpg

Guess you like

Origin www.cnblogs.com/whllow/p/12199881.html