In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to install Git on Ubuntu20.04". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to install Git on Ubuntu20.04.
Git is one of the most popular open source distributed version control systems. Because git can effectively and quickly handle project version management from very small to very large, it is adopted by many open source and commercial projects.
Use Apt to install Git
The Git package is included in Ubuntu's default software source repository and can be installed using the apt package management tool. This is the easiest and easiest way to install Git on Ubuntu.
If you want to compile and install the latest Git version from the Git source code, please follow the section "installing Git from the source code".
The installation is straightforward, running the following command only as the sudo privileged user:
Sudo apt updatesudo apt install git
Run the following command to print the Git version and verify the installation process:
Git-version
At the time of writing, the currently available version of Git under Ubuntu 20.04 is 2.25.1:
Git version 2.25.1
That's all. You have successfully installed Git on your Ubuntu, and you can start using it.
Install Git from the source code
The biggest advantage of installing Git from source is that you can compile the latest Git distribution and customize the compilation options. In any case, you will not be able to maintain your Git installation process through apt Software Manager.
Start installing dependent packages to build Git on your Ubuntu system:
Sudo apt updatesudo apt install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev make gettext libz-dev libssl-dev libghc-zlib-dev
Next, open your browser, browse the Git project image on Github and copy the latest distribution link URL that ends with .tar.gz. At the time of writing, the latest stable version of Git is 2.26.2:
We will download and extract the Git source code to the / usr/src directory. This directory is usually used to place the source code.
Wget-c https://github.com/git/git/archive/v2.26.2.tar.gz-O-| sudo tar-xz-C / usr/src
When the download is complete, change the source directory and run the following command to compile and install Git:
Cd / usr/src/git-*sudo make prefix=/usr/local allsudo make prefix=/usr/local install
The compilation process takes several minutes. Once complete, verify the installation process and run:
Git-version
The output is as follows:
Git version 2.26.2
Later, when you want to upgrade to a new version of Git, use the same process.
3. Configure Git
The first thing to do after you install Git is to configure your Git user name and email address. Git correlates your identity with each commit code.
To set the global commit name and email address, run the following command:
Git config-global username "Your Name" git config-global user.email "youremail@yourdomain.com"
You can verify the configuration by entering:
Git config-list
The output should look like this:
User.name=Your Nameuser.email=youremail@yourdomain.com
The configuration file is stored in the ~ / .gitconfig file:
[user] name = Your Name email = youremail@yourdomain.com
If you make further changes to the Git configuration, you can use the gitconfig command (recommended) or manually edit the ~ / .gitconfig file.
Thank you for reading, the above is the content of "how to install Git on Ubuntu20.04". After the study of this article, I believe you have a deeper understanding of how to install Git on Ubuntu20.04, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.