在使用git时,出现“git: command not found”的情况,于是使用yum安装:

[root@localhost ~]# yum install -y git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
Setting up Install Process
No package git available.
Nothing to do

需要先添加EPEL(Extra Packages for Enterprise Linux) repository:
[root@localhost ~]# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Retrieving http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
warning: /var/tmp/rpm-xfer.GsvZWW: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]

现在可以使用yum安装了
[root@localhost ~]# yum install -y git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* epel: mirrors.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
epel | 3.4 kB 00:00  
epel/primary_db | 3.1 MB 00:01  
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package git.i386 0:1.7.4.1-1.el5 set to be updated
--> Processing Dependency: perl-Git = 1.7.4.1-1.el5 for package: git
--> Processing Dependency: perl(Error) for package: git
--> Processing Dependency: perl(Git) for package: git
--> Running transaction check
---> Package perl-Error.noarch 1:0.17010-1.el5 set to be updated
---> Package perl-Git.i386 0:1.7.4.1-1.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================
Package Arch Version Repository Size
========================================================================================================
Installing:
git i386 1.7.4.1-1.el5 epel 4.5 M
Installing for dependencies:
perl-Error noarch 1:0.17010-1.el5 epel 26 k
perl-Git i386 1.7.4.1-1.el5 epel 28 k

Transaction Summary
========================================================================================================
Install 3 Package(s)
Upgrade 0 Package(s)

Total download size: 4.5 M
Downloading Packages:
(1/3): perl-Error-0.17010-1.el5.noarch.rpm | 26 kB 00:00  
(2/3): perl-Git-1.7.4.1-1.el5.i386.rpm | 28 kB 00:00  
(3/3): git-1.7.4.1-1.el5.i386.rpm | 4.5 MB 00:02  
--------------------------------------------------------------------------------------------------------
Total 1.4 MB/s | 4.5 MB 00:03  
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 217521f6
epel/gpgkey | 1.7 kB 00:00  
Importing GPG key 0x217521F6 "Fedora EPEL <epel@fedoraproject.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : perl-Error 1/3
Installing : perl-Git 2/3
Installing : git 3/3

Installed:
git.i386 0:1.7.4.1-1.el5

Dependency Installed:
perl-Error.noarch 1:0.17010-1.el5 perl-Git.i386 0:1.7.4.1-1.el5

Complete!

[root@localhost ~]#

http://blog.csdn.net/wangyutian2011/article/details/44056783

git: command not found的更多相关文章

  1. [Tool] SourceTree初始化GitFlow遇到错误(git command not found)的解决方案

    [Tool] SourceTree初始化GitFlow遇到错误(git command not found)的解决方案 问题情景 使用SourceTree,可以方便开发人员快速的套用GitFlow开发 ...

  2. Cordova 3.0 Plugin 安装 及"git" command line tool is not installed

    根据http://docs.phonegap.com/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface Windows命令行 ...

  3. [Practical Git] Navigate git command pager output with Unix less commands

    When using a git command that can have a large amount of output (like git log, git diff, or git blam ...

  4. 警告: git command could not be found. Please create an alias or add it to yo

    5 Answers active answertab=oldest#tab-top" title="Answers in the order they were provided& ...

  5. Git Command之Code Review

    原文链接 准备 Step 1. Create a team and add a teammate Step 2. Create a repository with some content 应用 Cl ...

  6. git command

    下载github代码 git clone https://github.com/zhoug2020/2015.git 在github上创建仓库: Create a new repository on ...

  7. git command line 提交代码

    echo "# spring-boot-apollo-demo" >> README.md git init git add README.md git commit ...

  8. 解决git: 'subtree' is not a git command. See 'git --help'.

    一.第一方法 git clone https://github.com/git/git.git cd git/contrib/subtree sudo make prefix=/usr sudo ma ...

  9. fuck--Fix git command line spelling errors GitHub

    修复Git输入错误,挺有意思.git命令关键字如果输入错误,会提示最接近的正确关键字,如果提示内容是你想要的,输入'fuck',就能执行了. GitHub源码.源码生成exe,windows上运行. ...

随机推荐

  1. 【三支火把】---一份程序看懂C程序printf()的几种常用用法

    闲来继续巩固我的学习之路,今天略微整理了一下,C程序中Printf()的一些常用用法,虽然自己以前好像会,但是不够系统,今天大致整理了一些,先贴上来看看,以后在看到其他,继续补充,希望能帮到一些像我一 ...

  2. Cocos2d-x学习笔记之Cocos2d-x开发环境搭建

    作者:刘昊昱 博客:http://blog.csdn.net/liuhaoyutz Cocos2d-x源码包下载地址: http://cocos2d-x.org/projects/cocos2d-x/ ...

  3. IOS Label 自动换行 IOS6和IOS7

    IOS 6和ios7 不一样,所以,我们分开来: IOS6: //计算实际frame大小,并将label的frame变成实际大小     CGSize size01 = [ssizeWithFont: ...

  4. CameraTest

    from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage #device = MonkeyRunner.wa ...

  5. wechat server的配置

    一 服务器地址 https://github.com/donal-tong/wechat4server 包括源代码及数据库脚本放在dump文件夹里 1.根据sql脚本创建需要的数据库hcapi,然后命 ...

  6. Ajax之旅(一)--什么是Ajax

    本来在学习DRP,但是无意中发现所附资料中有一些參考书籍,当中就有一个关于Ajax的,看了看,挺好的,于是决定暂停一下DRP,再次学习一下Ajax.记得第一遍学习Ajax的时候认为真的是一团雾水,看了 ...

  7. [分享]Ubuntu12.04安装基础教程(图文)

    [分享]Ubuntu12.04安装基础教程(图文) 原文地址: http://teliute.org/linux/Ubsetup/lesson21/lesson21.html 1.进入 live cd ...

  8. sql语法:inner join on, left join on, right join on具体用法

    inner join(等值连接) 仅仅返回两个表中联结字段相等的行 left join(左联接) 返回包含左表中的全部记录和右表中联结字段相等的记录 right join(右联接) 返回包含右表中的全 ...

  9. 读&lt;大数据日知录:架构与算法&gt;有感

    前一段时间, 一个老师建议我能够学学 '大数据' 和 '机器学习', 他说这必定是今后的热点, 学会了, 你就是香饽饽.在此之前, 我对大数据, 机器学习并没有非常深的认识, 总觉得它们是那么的缥缈, ...

  10. careercup-树与图 4.8

    4.8 你有两棵非常大的二叉树:T1,有几百万个结点:T2,有几百个结点.设计一个算法,判断T2是否为T1的子树. 如果T1有这么一个结点n,其子树与T2一模一样,则T2C++实现代码: #inclu ...