Home  >  Article  >  Operation and Maintenance  >  How to install Git on Linux and Windows systems

How to install Git on Linux and Windows systems

王林
王林forward
2023-05-23 11:43:441415browse

  1. Installing Git on Linux

For Linux, there are many ways to install Git. If you are using Ubuntu or Debian system, you can run the following command to install:

$ sudo apt-get update
$ sudo apt-get install git

For Red Hat-based systems (such as Fedora and CentOS), you can use the following command to install:

$ sudo yum install git

For other Linux distributions, please use the corresponding package manager to install Git.

  1. Installing Git on Windows

In order to use Git on Windows systems, you need to first download the Windows version of Git installer. To download the latest version of the Git installer, go to the Git official website (https://git-scm.com/).

The installer does not require configuration, just follow the wizard. After the installation is complete, you need to configure Git in the command line terminal. Open the Git Bash terminal and enter the following command:

$ git config --global user.name "Your Name"
$ git config --global user.email "your_email@example.com"

After the configuration is completed, you can use Git commands.

  1. Verify Git installation

After completing the installation, you need to verify whether Git has been successfully installed. You can execute the following command in the command line terminal:

$ git --version

If version information similar to "git version 2.17.1" is output, it means that Git has been successfully installed.

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

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete