Home  >  Article  >  Development Tools  >  How to use Git

How to use Git

藏色散人
藏色散人Original
2018-11-15 14:24:4838782browse

This article mainly introduces how to use Gitthat is, the initial use of Git.

Git is an open source distributed version control system for agile and efficient handling of any project, small or large. So in the previous article, I have introduced to you in detail What is Git and Git tool installation. Friends who need it can refer to it first.

After we install the Git tool locally, how do we start using it?

Now we will introduce to you the initial use of Git tools.

First of all, we can open a folder at will, right-click the mouse, and the following marks will appear.

How to use Git

Here we can click Git bash here to open the command line mode of the Git tool.

How to use Git

Since Git is a distributed version control system, you need to fill in the user name and contact information such as email or mobile phone number as an identifier to tell Git you Who can do more with Git?

We need to use two command statements:

git config  --global user.name
git config  --global user.phone

Enter these two statements in the Git command line and press Enter. The operation is as follows:

How to use Git

Here we directly entered the above two statements and set the name and number respectively. git config --global parameter, with this parameter, it means that all Git warehouses on your machine will use this configuration. Of course, you can also specify different user names and emails for a certain warehouse.

So how to check whether the username and number here are successfully submitted to Git?

We can directly execute the following command:

git config  --list

How to use Git

How to use Git

##As shown in the picture, you can see our internal settings Good some information. Some friends here may find that there is no mailbox set up above, but now there is an additional mailbox. This is because when I used Git before, I defined the mailbox once. By default, it will not be cleared when I use it again, and if we reset the new The old mailbox will be overwritten only when the new mailbox is added.


Then the command statement to set up the mailbox is also very simple as follows:

git config  --global user.email

Through the above simple Git operations, we can use Git tools more specifically, such as Git to create a repository wait.

This article is a preliminary introduction to the use of Git. I hope it will be helpful to friends in need!

The above is the detailed content of How to use Git. For more information, please follow other related articles on the PHP Chinese website!

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