How to install git from Linux source code: 1. Download the git source code and upload it to the Linux server; 2. Log in to the target machine, decompress and install; 3. Install "gcc gcc-c"; 4. Perform the git installation Just order.
The operating environment of this article: linux5.9.8 system, git version 2.9.5, Dell G3 computer.
How to install git from Linux source code?
Linux installation git/source code installation:
Git installation
I won’t record Windows/Mac OS systems here. Just download the corresponding installation program and install it according to the steps.
Linux installation
Log in to https://git-scm.com/download/linux
Source code installation
1. Download the source code
You can download the source code on another computer and then upload it to the Linux server
https://mirrors.edge.kernel.org/pub/software/scm/git/
to find the corresponding version.
2. Upload to the server
Using git-2.9.5.tar.gz as an example, upload the downloaded file to the server.
scp git-2.9.5.tar.gz root@192.168.0.102:/home/tools
scp git-2.9.5.tar.gz Target machine user@target machine ip: target machine path
3. Unzip and install
Log in to the target machine, Unzip and install. /home/Git refers to the installation directory
tar -zxvf git-manpages-2.9.5.tar.gz cd git-2.9.5 [root@localhost git-2.9.5]# ./configure --prefix=/home/Git [root@localhost git-2.9.5]# make && make install 4. ./configure 报错 [root@localhost git-2.9.5]# ./configure --prefix=/home/Git configure: Setting lib to 'lib' (the default) configure: Will try -pthread then -lpthread to enable POSIX Threads. configure: CHECKS for site configuration checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/home/tools/git-2.9.5': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details
It can be seen from my Linux server execution error that gcc, cc, cl.exe is no. gcc is the c language compiler for Linux, which means these compilers are not installed on my machine.
Install the following gcc and gcc-c respectively. After successful installation, execute the git installation command
[root@localhost git-2.9.5]# yum install gcc [root@localhost git-2.9.5]# yum install gcc-c++ [root@localhost git-2.9.5]# ./configure --prefix=/home/Git
5. The make command reports an error
[root@localhost git-2.9.5]# make && make install * new build flags CC credential-store.o In file included from credential-store.c:1:0: cache.h:40:18: 致命错误:zlib.h:没有那个文件或目录 #include <zlib.h> ^
The compilation is interrupted.
make: *** [credential-store.o] Error 1
The zlib header file is missing and the development package is not installed. Install zlib
[root@localhost git-2.9.5]# yum install zlib [root@localhost git-2.9.5]# yum install zlib-devel [root@localhost git-2.9.5]# yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker [root@localhost git-2.9.5]# make && make install
If no error is reported, the installation is successful
6. Check whether the git installation is completed
Enter the previously specified installation directory and check the git version, it will be successful It means that the git installation is complete
[root@localhost bin]# cd /home/Git/bin [root@localhost bin]# ./git --version git version 2.9.5
7. Configure environment variables
vi /etc/profile
Edit the environment variable configuration file, append the following string at the end, and specify the address of the bin directory
export PATH=$PATH://home/Git/bin
After the modification is completed, execute the command to take effect in the configuration file
source /etc/profile
Check whether the configuration is successful. You can switch the path to another directory and execute git --version. Returning to the git version indicates that the environment variable configuration is completed.
Recommended study: "Git Tutorial"
The above is the detailed content of How to install git for linux source code. For more information, please follow other related articles on the PHP Chinese website!

The role and function of Git and GitHub in software development is to manage code and collaborative development. Git efficiently manages code versions through commit, branch and merge functions, while GitHub provides code hosting and collaboration tools such as PullRequest and Issues to improve team collaboration efficiency.

GitHub is the preferred platform for developers to discover, share and contribute code. 1) Find specific code bases through search functions, such as Python projects. 2) Create a repository and push code to share with developers around the world. 3) Participate in open source projects and contribute code through Fork and PullRequest.

Git is a version control system, and GitHub is an online platform based on Git. The steps to using Git and GitHub for code management and team collaboration include: 1. Initialize the Git repository: gitinit. 2. Add files to the temporary storage area: gitadd. 3. Submit changes: gitcommit-m"Initialcommit". 4. Related to the GitHub repository: gitremoteaddoriginhttps://github.com/username/repository.git. 5. Push code to GitHub: gitpush-uoriginmaste

GitHub has a far-reaching impact on software development and collaboration: 1. It is based on Git's distributed version control system, which improves code security and development flexibility; 2. Through functions such as PullRequest, it improves team collaboration efficiency and knowledge sharing; 3. Tools such as GitHubActions help optimize the development process and improve code quality.

The methods of sharing, managing and contributing code on GitHub include: 1. Create a repository and push code, and write README and LICENSE files; 2. Use branches, tags and merge requests to manage code; 3. Fork the repository, modify and submit PullRequest contribution code. Through these steps, developers can effectively use GitHub to improve development efficiency and collaboration capabilities.

Git is a distributed version control system, and GitHub is a Git-based collaboration platform. Git is used for version control and code management, while GitHub provides additional collaboration features such as code review and project management.

Git is a distributed version control system, and GitHub is an online platform based on Git. Git is used for version control, branch management and merger, and GitHub provides code hosting, collaboration tools and social networking capabilities.

Git is a back-end version control system, and GitHub is a front-end collaboration platform based on Git. Git manages code version, GitHub provides user interface and collaboration tools, and the two work together to improve development efficiency.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Zend Studio 13.0.1
Powerful PHP integrated development environment

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools
