Linux手动安装和部署github

14 篇文章 1 订阅
3 篇文章 0 订阅

Git简介

Git是什么?
Git是目前世界上最先进的分布式版本控制系统(没有之一)。
Git有什么特点?简单来说就是:高端大气上档次!

第一步:安装wget

  • yum -y install wget
  • yum -y install setup
  • yum -y install perl
    依次安装

第二步:去码云下载最新Git包

  • 地址:https://github.com/git/git/archive/
  • linux安装命令:wget https://github.com/git/git/archive/v2.23.0.tar.gz

第三步:在Centos安装相关Git依赖

  • yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtuls-CBuilder perl-ExtUtuls-MakeMaker

第四步:解压安装包

  • 在linux环境中解压tar.gz压缩包
  • 使用命令 tar -zxvf v2.23.0.tar.gz

第五步:进入git目录

  • 命令:cd git-2.23.0/

第六步:安装GCC

  • 命令:sudo yum install gcc

第七步:执行编译吗命令

  • make prefix=/usr/local/all

第八步:执行安装命令

  • make prefilx=/usr/local install

第九步:查看安装结果

  • 命令:git --version
    在这里插入图片描述
    表示安装成功

第十步:使用户git连接github

  • 命令:
  • ssh-keygen -t rsa -C "你的邮箱"
  • 生成公钥并存放在/root/.ssh/id_ras.pub
    在这里插入图片描述

第十一步:查看公钥并复制到github中SSH Key

  • 命令:cd /root/.ssh
  • cat id_rsa.pub
    在这里插入图片描述

第十二步:将公钥复制github中

  1. 注册github https://github.com/
    在这里插入图片描述
  2. 进入设置
    在这里插入图片描述
  3. 点击SSH and GPG Keys并添加公钥
    在这里插入图片描述
  4. 输入名称并将公钥粘贴,点击保存
    在这里插入图片描述

第十三步:检验连接

  • 命令:ssh -T git@github.com
    在这里插入图片描述

第十四步:建立Github仓库

  1. 新建
    在这里插入图片描述
  2. 编辑信息
    在这里插入图片描述
  3. 获取下载连接url
    在这里插入图片描述

第十五步:git上传本地文件github仓库

  • 进入git目录
    • cd git-2.23.0/
      克隆github文件
  • 命令:
    git clone https://github.com/zimeng-beer/Linux.git(复制的url)
    在这里插入图片描述
  • 克隆成功
    在这里插入图片描述
    上传到本地仓库
  • 命令:git add 文件名
    在这里插入图片描述
    添加上传文件描述
  • 命令:git commit -m '描述内容'
    在这里插入图片描述
    上传github仓库
  • 命令:git push origin master
    在这里插入图片描述
    在giuhub中分支可查看
    在这里插入图片描述

问题解决

报错如下:

[root@iZuf66v5ott4itjaz5ijoeZ Linux]# git commit -m 'ces'



*** Please tell me who you are.



Run



  git config --global user.email "you@example.com"

  git config --global user.name "Your Name"



to set your account's default identity.

Omit --global to set the identity only in this repository.



fatal: unable to auto-detect email address (got 'root@iZuf66v5ott4itjaz5ijoeZ.(none)')

[root@iZuf66v5ott4itjaz5ijoeZ Linux]# git commit -m "masn"



*** Please tell me who you are.



Run



  git config --global user.email "you@example.com"

  git config --global user.name "Your Name"



to set your account's default identity.

Omit --global to set the identity only in this repository.



fatal: unable to auto-detect email address (got 'root@iZuf66v5ott4itjaz5ijoeZ.(none)')

解决办法:

命令:
git config --global user.name "用户名"
git config --global user.email 邮箱@qq.com
在这里插入图片描述
在这里插入图片描述

  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Dreamer_code

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值