Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Introduction to Git Foundation (2) Git installation and configuration

Shulou Source: shulou.com Published: 2022-06-03 00:43:38 10月03日 Update

Sudo apt-get install git # install Git (ubuntu)

Git clone git://git.kernel.org/pub/scm/git/git.git # Update Git

Configuration before running Git for the first time:

Git comes with a git config tool to help set configuration variables that control the appearance and behavior of Git

These variables are stored in three different locations:

/ etc/gitconfig: contains the common configuration of every user on the system and their warehouse,-- system configures the system level

~ / .gitconfig or ~ / .config / git/config: for current users only,-- global configures users globally

.git / config: configuration file for the repository

Each level overrides the previous level of configuration, so the configuration of .git / config overrides the configuration in / etc/gitconfig

User Information:

The first thing you should do after installing Git is to set your user name and email address. Every Git submission will use this information, and it will be written to your every submission:

Git config-global user.name "huyuan"

Git config-global user.email huyuan@example.com

Editor configuration:

Git config-global core.editor vim

Check configuration information

Use the git config-- list command to list all the configurations that Git can find at that time

$git config-list

User.name=John Doe

User.email=johndoe@example.com

Core.editor=vim

Color.status=auto

.

If there is a duplicate variable name, Git uses the last configuration of each variable it finds

Git config: to check one of the configurations of Git

$git config user.name

Huyuan

Get help

Git help

Git-help

Man git-

Tags: Configuration user variable information level warehouse system help check different three location global name command address appearance that is tools files Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Tech Info OPPO Reno Docker Linux