git version control system -- managed code, not afraid to delete Library

1. Introduction to git version control system

Version control system is a software skill to ensure that the consent files edited by different people are updated during the development process. It can help project developers track, branch, merge and manage code versions. At present, the common version control systems are CVS, GIT, mercury, Subversion and so on. Git version control system is the GIT management system used by most companies and projects. Many websites provide svn and git servers hosted by source code. Because most companies and projects are managed by git, there are fewer hosting servers supporting svn.

2. Characteristics of git version control system

Git - The stupid content tracker. Linus Torvalds (the father of Linux) introduced git to us in this way.
The biggest difference between distributed and centralized is that developers can submit to the local. Each developer copies a complete Git warehouse on the local machine through git clone.

3. The difference between git and svn

  1. GIT stores the contents incrementally according to the original data mode, while SVN stores them according to files;
  2. GIT is distributed, while SVN is centralized management;
  3. GIT branch is different from SVN branch;
  4. Git content integrity should interfere with SVN, and git content storage uses hash algorithm;
  5. SVN has a global integer number, while GIT is a SHA-1 value for numbering;
  6. SVN can be controlled to a certain directory, while GIT is generally the whole project.

4. git installation and version library creation under Linux environment

1. Installation:
Enter the sudo apt get install git command:

liruiyan@cloud-ubuntu18:~/git$ sudo apt-get install git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
git is already the newest version (1:2.17.1-1ubuntu0.8).
0 upgraded, 0 newly installed, 0 to remove and 191 not upgraded.

If Y/N appears, select Y and enter git command:

usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

2. Create version Library
New directory test_git, create the version library git init in this directory

liruiyan@cloud-ubuntu18:~/git$ mkdir test_git
liruiyan@cloud-ubuntu18:~/git$ ls
test_git
liruiyan@cloud-ubuntu18:~/git$ cd test_git/
liruiyan@cloud-ubuntu18:~/git/test_git$ git init
Initialized empty Git repository in /home/liruiyan/git/test_git/.git/
liruiyan@cloud-ubuntu18:~/git/test_git$ ls -la
total 12
drwxrwxr-x 3 liruiyan liruiyan 4096 Jul 10 11:40 .
drwxrwxr-x 3 liruiyan liruiyan 4096 Jul 10 11:39 ..
drwxrwxr-x 7 liruiyan liruiyan 4096 Jul 10 11:40 .git

5. Create personal warehouse under git

5.1 access git official website https://gitee.com/ Create account password:

5.2 create warehouse:
5.3 add open source license:

5.4 configuring git under Linux:
Enter the following command to view the public key

cat ~/.ssh/id_rsa.pub

5.5 copy and paste SSH public key into git personal account:


5.6 test whether the public key is successfully added under Linux:

ssh -T git@git.oschina.net


5.7 cloning under Linux:

git clone https://gitee.com/mierya/MQTT


5.8 now we can access our git warehouse in the browser:

The next blog will learn how to host your own code in git repository.
Reference blog: https://blog.csdn.net/weixin_42825585/article/details/88781905?utm_medium=distribute.pc_relevant.none -task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1. pc_ relevant_ baidujshouduan&depth_ 1-utm_ source=distribute. pc_ relevant. none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1. pc_ relevant_ baidujshouduan
https://blog.csdn.net/makunit/article/details/107255252

Keywords: Linux

Added by robvan75 on Sun, 16 Jan 2022 08:17:45 +0200