centos 安装Git-cola

本文介绍如何在CentOS上安装Git-cola图形界面工具和Git-all软件包。通过从源码运行Git-cola来体验最新功能,并解决安装过程中遇到的依赖问题。

首先安装Git

sudo yum -y install git*

找到 git-all.noarch , 安装这个.

sudo yum install git-all.noarch

============ 以下是git-cola的文档内容 ==========

因为貌似Centos的yum没有提供cola的下载. 我用了git-gui一个下午果断弃了.

然后去git-cola的官网下了他的源码. 找到了一份叫readme的文档.

找到了下面这些:

## RUN FROM SOURCE

You don‘t need to install *git-cola* to run it.
Running *git-cola* from its source tree is the easiest
way to try the latest version.

    git clone git://github.com/git-cola/git-cola.git
    cd git-cola
    ./bin/git-cola
    ./bin/git-dag

Having *git-cola*‘s *bin/* directory in your path allows you to run
*git cola* like a regular built-in Git command:

    # Replace "$PWD/bin" with the path to git-cola‘s bin/ directory
    PATH="$PWD/bin":"$PATH"
    export PATH

    git cola
    git dag

The instructions below assume that you have *git-cola* present in your
`$PATH`.  Replace "git cola" with "./bin/git-cola" as needed if you‘d like to
just run it in-place.

# INSTALLATION

Normally you can just do "make install" to install *git-cola*
in your `$HOME` directory (`$HOME/bin`, `$HOME/share`, etc).
If you want to do a global install you can do

    make prefix=/usr install

There are also platform-specific installation methods.
You‘ll probably want to use one of these anyways since they
have a nice side-effect of installing *git-cola*‘s PyQt4
and argparse dependencies.

首先是去git-cola的Github那里下载git-cola

git clone git://github.com/git-cola/git-cola.git && cd git-cola

然后执行:

./bin/git-cola
./bin/git-dag

发现可以跑起来了. 然后是安装到系统... 执行

make prefix=/usr install

安装就可以了. 期间可能会提示安装不成功, 因为缺少了一个Qt4的库, 顺水推舟地用下面的指令安装了Qt4, 再重新make一次即可:

sudo yum install PyQt4

如果出现ImportError: No module named argparse

easy_install argparse

 至于使用的方法嘛, 跟乌龟的差不多~

文件打开项目的根目录. 然后右键"在终端中打开"... 在终端中输入:

git cola

即可....

<think>我们正在CentOS系统上安装git-filter-repo。根据引用[1],我们知道在CentOS 7上,git版本需要2.24.4,Python需要3.6.6。同时,引用[1]中提供了通过源码安装的方法。 但是,我们也可以考虑使用包管理器安装(如果可用)或者手动安装。 步骤: 1. 检查环境:确保Git和Python3版本满足要求。 2. 安装方法: a) 通过源码安装(如引用[1]所示) b) 使用yum安装(如果仓库中有的话,但CentOS官方仓库可能没有,所以可能需要手动安装) 根据引用[1]的步骤: - 克隆git-filter-repo源码 - 将可执行文件复制到/usr/local/bin 另外,注意引用[3]中显示在CentOS上使用yum安装httpd和创建目录,但并没有直接关于git-filter-repo的信息。 因此,我们给出两种方法: 方法一:手动安装(推荐,因为CentOS官方仓库可能没有) 方法二:尝试使用yum安装(如果不成功再用手动方法) 然而,经过查询,CentOS默认仓库没有git-filter-repo,所以通常采用手动安装。 具体步骤: 1. 确认环境: ```bash git --version python3 --version ``` 2. 如果Python3未安装,需要先安装CentOS7默认可能只有Python2): ```bash sudo yum install -y python3 ``` 3. 安装git-filter-repo: ```bash # 克隆仓库 git clone https://github.com/newren/git-filter-repo.git # 进入目录 cd git-filter-repo # 复制可执行文件到系统路径 sudo cp git-filter-repo /usr/local/bin ``` 4. 验证安装: ```bash git filter-repo --version ``` 另外,也可以直接下载脚本(如果不想克隆整个仓库): ```bash wget https://raw.githubusercontent.com/newren/git-filter-repo/main/git-filter-repo -O /usr/local/bin/git-filter-repo sudo chmod +x /usr/local/bin/git-filter-repo ``` 注意:如果/usr/local/bin不在PATH中,请确保将其加入PATH,或者选择其他已在PATH中的目录。 根据引用[1]中的步骤,我们也可以直接复制到/usr/local/bin。 所以,我们总结步骤: 步骤1:安装依赖(Git和Python3) 步骤2:下载git-filter-repo脚本 步骤3:放到系统路径并赋予执行权限 我们写一个完整的步骤: ### CentOS 7 安装 git-filter-repo #### 环境准备 1. **安装依赖**: ```bash sudo yum install -y git python3 ``` 2. **验证环境**: ```bash git --version # 确保版本>=2.22.0(最好>=2.24.0) python3 --version # 确保版本>=3.5 ``` #### 安装步骤 **方法1:直接下载脚本(推荐)** ```bash # 下载官方脚本到系统路径 sudo wget https://raw.githubusercontent.com/newren/git-filter-repo/main/git-filter-repo -O /usr/local/bin/git-filter-repo # 添加执行权限 sudo chmod +x /usr/local/bin/git-filter-repo ``` **方法2:克隆仓库安装(可选)** ```bash # 克隆仓库 git clone https://github.com/newren/git-filter-repo.git # 复制脚本 sudo cp git-filter-repo/git-filter-repo /usr/local/bin/ # 添加执行权限(确保) sudo chmod +x /usr/local/bin/git-filter-repo ``` #### 验证安装 ```bash git filter-repo --version # 输出类似:git-filter-repo version 2.38.0 ``` #### 常见问题 - **权限问题**:确保`/usr/local/bin`可写,或使用`sudo`。 - **网络问题**:如果无法访问GitHub,可以尝试使用代理或从其他镜像下载。 - **命令未找到**:检查`/usr/local/bin`是否在`PATH`中,可通过`echo $PATH`查看。如果不在,可以将以下行添加到`~/.bashrc`: ```bash export PATH=$PATH:/usr/local/bin ``` 然后执行`source ~/.bashrc`。 --- §§相关问题§§ 1. 如何用 git-filter-repo 清理仓库历史中的大文件? 2. 如何升级 CentOS 7 上的 Git 到较新版本? 3. 在 CentOS 7 上如何安装 Python 3.6 或更高版本? </think> ### CentOS 系统安装 git-filter-repo 指南 #### 环境要求 1. **Git 版本**:$ \text{Git} \geqslant 2.22.0 $(推荐 $ \geqslant 2.24.0 $)[^1] 2. **Python 版本**:$ \text{Python 3} \geqslant 3.5 $(推荐 $ \geqslant 3.6 $)[^1] 3. 验证环境: ```bash git --version # 检查Git版本 python3 --version # 检查Python3版本 ``` #### 安装步骤 **方法1:脚本直接安装(推荐)** ```bash # 下载官方脚本 sudo wget https://github.com/newren/git-filter-repo/releases/download/v2.38.0/git-filter-repo -O /usr/local/bin/git-filter-repo # 添加执行权限 sudo chmod +x /usr/local/bin/git-filter-repo ``` **方法2:源码安装** ```bash # 安装依赖 sudo yum install -y git python3 # 克隆源码仓库 git clone https://github.com/newren/git-filter-repo.git # 安装到系统路径 cd git-filter-repo sudo cp git-filter-repo /usr/local/bin/ ``` **方法3:Python pip 安装** ```bash # 安装pip(如未安装) sudo yum install -y python3-pip # 通过pip安装 sudo pip3 install git-filter-repo ``` #### 验证安装 ```bash git filter-repo --version # 成功输出示例:git-filter-repo version 2.38.0 ``` #### 常见问题解决 1. **Python 版本过低**: ```bash # 安装 Python 3.6 sudo yum install -y centos-release-scl sudo yum install -y rh-python36 scl enable rh-python36 bash ``` 2. **Git 版本过低**: ```bash # 安装 IUS 仓库并升级 Git sudo yum install -y https://repo.ius.io/ius-release-el7.rpm sudo yum swap -y git git224 ``` 3. **命令未找到**: 确保`/usr/local/bin`在`PATH`中: ```bash echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bashrc source ~/.bashrc ``` ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值