在使用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. 注册表-恶意首页追踪之旅(IE不能改主页)

    恶意首页追踪之旅(先说下,360无法修复这个恶意首页) 话说,今天下了个扫站的工具,结果一不小心中了恶意广告! 中招后不停的乱下东西安装,360不停的在那弹出提示! 无语了,一个个卸载,把C:\win ...

  2. Java 解析epub格式电子书,helloWorld程序,附带源程序和相关jar包

    秀才坤坤出品 一.epub格式电子书 相关材料和源码均在链接中可以下载:http://pan.baidu.com/s/1bnm8YXT 包括 1.JAVA项目工程test_epub,里面包括了jar包 ...

  3. oncopy和onpaste

    在Javascript中,有对应的事件能够监听复制和粘贴,那就是oncopy和onpaste. oncopy: demo: <body oncopy="alert('不能复制');re ...

  4. navicate恢复数据

    恢复psc文件,出现记录数为0 不要使用事务,选用遇到错误继续

  5. NGUI 3.5教程(六)Font字体

    字体是UI很重要的一部分.今天用NGUI 3.5,制作一下字体. 以下是我做的一个射击游戏的DEMO.子弹数量,就使用了NGUI的字体显示.效果例如以下: 步骤: 1,寻找(或者制作)字体.我这里图方 ...

  6. nginx模块编程之获取客户ip及端口号

    ngx_request_t结构体中有一个connection定义,该定义指向一个ngx_connection_t的结构体: 结构体定义如下: struct ngx_connection_s { voi ...

  7. vs目录(继承的值)配置

    突然间,想在vs中添加自己的目录,这样以后再新建项目后,就不用再麻烦的手动添加了,比如让新建的项目都继承我的目录D:\MyInc. 事例:让新建的工程包含的目录中自动继承目录D:\MyInc 修改它的 ...

  8. Cocos2d-x实现粒子效果的三种方式

    在Cocos2d-x中,实现粒子效果可以有三种方法. Normal 0 10 pt 0 2 false false false EN-US ZH-CN X-NONE $([{£¥·'"〈&l ...

  9. sudo 免密码

    转自:sudo 免密码 很多都是修改/etc/sudoers权限为740再加上一句 ALL=NOPASSWD:ALL 或者加一句 yourname ALL=(ALL) NOPASSWD: ALL 然后 ...

  10. JSTL-core核心代码标签库中的forEach,remove, forTokens,choose,when,otherwise,redirect 标签

    <%@ page language="java" import="java.util.*, cn.hncu.domain.*" pageEncoding= ...