linux安装git的方法步骤

发布时间:2024-07-13 点击:73
服务器
1、简介
git是一款免费、开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目。
git是一个开源的分布式版本控制系统,用以有效、高速的处理从很小到非常大的项目版本管理。
git 是 linus torvalds 为了帮助管理 linux 内核开发而开发的一个开放源码的版本控制软件
安装环境
阿里云ecs centos 7.4 64位
2、使用shell安装git
请将下载的shell与下面代码保存到同一目录
cnl_function.sh
#!/bin/bashsource ./cnl_function.sh#function of installing gitinstall_git(){ #download the compressed package cd /usr/local/src #if compressed package is empty then download [ -f git-2.2.1.tar.gz ] || wget https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.gz check_ok tar -zxf git-2.2.1.tar.gz check_ok [ -d /usr/local/git ] && mv /usr/local/git /usr/local/git_`date %s` cd git-2.2.1 check_ok for p in expat-devel do myum $p done make prefix=/usr/local/git all make prefix=/usr/local/git install check_ok if ! grep \\\'^git:\\\' /etc/group then groupadd git fi if ! grep \\\'^git:\\\' /etc/passwd then useradd -m git -s /usr/local/git/bin/git-shell -g git fi check_ok ln -s /usr/local/git/bin/git /usr/local/bin/git echo git is installed finish. }read -p enter (y) to start installation git : nif [ $n == \\\'y\\\' ]then echo start installation==============================================================================================================================> install_gitelse echo cancel the installation.fi如下图,我将上面代码保存位cnl_install_git.sh
执行脚本,按提示输入即可
命令行执行
git --version
安装完成。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持西部数码。

这个是什么问题-备案平台
宣城云存储服务器租用
中国零售商超全渠道融合发展年度报告
网站文章问题-其他问题
电脑中如何安装摄像头驱动
华南高宽带低价云服务器购买流程
服务器带宽如何正确估算和选择
破拆运营:再谈网站运营那点事