服务器 配置git

参考了下面这篇文章,不对的地方做了改正

在服务器上git clone github项目的过程-CSDN博客

1. 下载解压

wget https://www.kernel.org/pub/software/scm/git/git-2.34.1.tar.gz
tar -zxvf git-2.34.1.tar.gz

2. 安装

cd  git-2.34.1/ 
./configure  
make configure 

 这里也许会遇到一个错误,报错 “/bin/sh: 1: autoconf: not found make: *** [Makefile:2410: configure] Error 127”。这是由于 autoconf 未安装。使用如下命令安装:

sudo apt-get update
sudo apt-get install autoconf

安装后再次执行 make configure,结果如下,就可以开心地继续啦 

./configure --prefix=home/git
 make -j16 && make install  

 make 的时候可能又会碰到一个报错 “/bin/sh: 1: msgfmt: not found MSGFMT po/build/locale/is/LC_MESSAGES/git.mo make: *** [Makefile:2691: po/build/locale/de/LC_MESSAGES/git.mo] Error 127 make: *** Waiting for unfinished jobs....” 这是由于gettext未安装,使用如下命令

sudo apt-get install gettext

再次 make 就能成功(摊) 别忘记 make install

3. ssh key

首先创建 key

ssh-keygen -t rsa -C "github账户的邮箱地址"

一路 enter 就行 

接着查看刚创建的 key

cd ~
cd .ssh
cat id_rsa.pub

复制这个 key,在 github 点击我的头像 - settings - SSH and GPG keys - new SSH key ,把秘钥贴进去

名称不重要,add 后就有权限 git clone 了。 git 就结束了呜呜

相关推荐

  1. 服务器配置Huggingface并git clone模型和文件

    2024-01-11 13:28:06       38 阅读
  2. <span style='color:red;'>Git</span><span style='color:red;'>配置</span>

    Git配置

    2024-01-11 13:28:06      64 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-11 13:28:06       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-11 13:28:06       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-11 13:28:06       87 阅读
  4. Python语言-面向对象

    2024-01-11 13:28:06       96 阅读

热门阅读

  1. linux: netstat 与 ss 用法详解

    2024-01-11 13:28:06       49 阅读
  2. Wargames与bash知识13

    2024-01-11 13:28:06       41 阅读
  3. 2024系统分析师---论软件需求管理

    2024-01-11 13:28:06       56 阅读
  4. 在Microsoft Edge中访问只能在IE中加载的页面

    2024-01-11 13:28:06       48 阅读
  5. 关于ubuntu20.04(Linux)屏幕突然横屏的解决方案

    2024-01-11 13:28:06       58 阅读
  6. 用PHP来模拟雨滴的动态效果

    2024-01-11 13:28:06       59 阅读
  7. 1. Logback介绍

    2024-01-11 13:28:06       50 阅读
  8. Python快速排序

    2024-01-11 13:28:06       55 阅读
  9. 补充 vue3用户管理权限(路由控制)

    2024-01-11 13:28:06       57 阅读
  10. Python专家编程系列: 8. 高级数据结构介绍

    2024-01-11 13:28:06       41 阅读