Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction, installation, configuration, generation of public keys and examples of getting help for Git tools

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the introduction, installation, configuration, generation of public key and examples of getting help of Git tools. The introduction in this article is very detailed and has certain reference value. Friends who are interested must finish reading it.

Git

As a leader in version control tools, Git has become the version control tool used by most developers. Unlike centralized version control tools, Git is a distributed version control tool with a complete history on each client. This has a great advantage in preventing a single point of failure.

So, are there any other features of Git?

Unlike other version control systems, Git directly records snapshots rather than differential backups

Almost all operations are local operations and can be completed without a network, so the speed is very fast.

The data is so secure that it will not be lost. Because every data is checked by Git before it is saved.

Workspace, staging area, version library

If you want to learn Git well, you need to understand these three and the relationship between them.

The figure above is a general process for using Git. First, the files of the workspace are temporarily stored in the temporary storage area, and then the contents of the temporary storage area are submitted to the version library, which will have a snapshot of the version in the version library.

Install git

Here is how to install Git

Install under windows

Using Git on Windows, you can download the installer directly from the Git website and next it all the time. Then right-click on the desktop, and if git bash appears, it means that the installation is successful.

Install under CentOS

Yum install git

First time configuration of Git

The configuration of Git is divided into three levels: global level, user level, and current repository. The configuration at the next level will cover the configuration at the previous level, for example, the configuration at the warehouse level will cover the user level and the global level, and the configuration at the user level will cover the configuration at the global level. Git comes with git config tools to read and set configuration information. The addresses of these configuration level profiles are as follows:

Global level, / etc/gitconfig

User level, ~ / .gitconfig

Warehouse level, .git / config under the current warehouse directory

User information

When we first install Git, all we need to do is set up the user name and the user's mailbox. If these things are not set up, they cannot be submitted. It is generally recommended to use user-level settings with the option-global. If you don't have-- global, the warehouse-level configuration is set by default.

Next, set up the user name and mailbox

$git config-global user.name "paul" $git config-global user.email "paul@163.com"

View configuration information

Once set up, let's see if the setting is successful, using git config-- list to list all the configuration parameters and values.

# git config-listuser.name=pauluser.email=paul@163.com

View individual configuration

# git config user.namepaul

Generate public key

Normally, after the first installation, we will also generate the public key. The command to generate the public key is as follows:

Ssh-keygen-t rsa-C 'youremail@example.com'

Then press enter 3 times. Generally speaking, we don't set the password, so we just enter the car. The public and private keys are then generated. Can be passed through

Cat / .ssh/id_rsa.pub

View public key content

Get help information

There are three equivalent ways to get help

Git help [commands] git [commands]-- helpman git [commands] these are all the contents of this article entitled "introduction, installation, configuration, generation of public keys and examples of getting help for Git tools". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report