The Git version in the yum source repository is not updated in time. The latest version of Git is 188.8.131.52. If you want to install the latest version of Git, you can only download the source code and install it.
yum info git Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Available Packages Name: git Arch: x86_64 Version: 184.108.40.206 Release: 14.el7_5 Size: 4.4 M Repo: updates/7/x86_64 Summary: Fast Version Control System URL: http://git-scm.com/ License: GPLv2 Description: Git is a fast, scalable, distributed revision control system with an : unusually rich command set that provides both high-level operations : and full access to internals. : : The git rpm installs the core tools with minimal dependencies. To : install all git packages, including tools for integrating with other : SCMs, install the git-all meta-package.
git has released version address https://github.com/git/git/releases
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel yum install gcc perl-ExtUtils-MakeMaker
Uninstall the low version of Git
yum remove git
Download the new version of the Git source package
tar -xzvf v2.18.0 -C ~/app/
cd ~/app/git-2.18.0 make prefix=/usr/local/git all make prefix=/usr/local/git install
Add to environment variables
echo "export PATH=$PATH:/usr/local/git/bin" >>/etc/bashrc source/etc/bashrc
git --version #git version 2.18.0
Specific configuration user information:
git config --system/--global/--local user.email "firstname.lastname@example.org" git config --system/--global/--local user.name "Your Name"
View configuration list
git config --local -l #View the warehouse-level configuration list git config --global --list #View the global configuration list git config --system -l # View the system-level configuration list
In addition to defining the .gitignore file in the project, the .gitignore file that defines the global Git can also set the global git .gitignore file to manage the behavior of all Git projects. This method is not shared between different project developers, and belongs to the Git application level behavior on the project. This method also requires the creation of a corresponding .gitignore file, which can be placed in any location. Then use the following command to configure Git:
# git config --global core.excludesfile ~/.gitignore
First of all, we must emphasize that the full file name of this file is ".gitignore". Note that there is a "." at the beginning. Generally speaking, every Git project needs a ".gitignore" file. The function of this file is to tell Git which files do not need to be added to version management.
The default editor nano of git in linux, nano is used to edit the submitted page, the exit method is: Ctrl + X, then enter y and then press Enter, you can exit. If you want to change the default editor nano to git Method one, Set core.editor in the GIT configuration: git config --global core.editor vim Method two, modify the .gitconfig file. Add editor = vim in core. In this way, vim will be automatically used as the editor when using git in the future
$ ssh-keygen -t rsa -C "email@example.com"
The key type can be specified with the -t option. If not specified, the RSA key for SSH-2 will be generated by default. Rsa is used here. At the same time, there is a comment field in the key. Use -C to specify the specified comment, which can facilitate the user to identify the key and point out the purpose of the key or other useful information. So enter your own email address here or anything else. After the input is completed, the program also asks to input a passphrase, empty means there is no passphrase. Then you will be asked to enter the password twice, empty means there is no password. Enter 3 times to complete the current step.
$ ssh-keygen -t rsa -C "firstname.lastname@example.org" Generating public/private rsa key pair. Enter file in which to save the key (/home/baxiang/.ssh/id_rsa): Created directory'/home/baxiang/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in/home/baxiang/.ssh/id_rsa. Your public key has been saved in/home/baxiang/.ssh/id_rsa.pub. The key fingerprint is: SHA256:Y4bxF3Aylak4SjOgmDnLaQODZFFPBHp8fuKbWkUTyYM email@example.com The key's randomart image is: +---[RSA 2048]----+ | .ooooo.=.oo | | o+ oE +.=o | |== + o.+... | |X. * ++o. | |o+.. *.+S. | |.= o +oo | |.. o | |. o | | ..o | +----[SHA256]-----+