CentOS 7 下git clone配置使用

这篇具有很好参考价值的文章主要介绍了CentOS 7 下git clone配置使用。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

参考博客:https://www.jianshu.com/p/39615b4d6b86

  1. 检查git是否安装和配置用户名和邮箱
git --version
git config --global user.name “你的名称”
git config --global user.email “你的邮箱”
git config --global user.password “xxxxx密码”

查看配置

git config --list
  1. 检查是否已安装ssh key
$ cd ~/.ssh
$ ls

检查是否已经存在 id_rsa.pub 或 id_dsa.pub 文件,如果文件已经存在,那么你可以跳过步骤2,直接进入步骤3

  1. 创建一个ssh key
$ ssh-keygen -t rsa

一路回车,执行完后再检查就发现已经有了 id_rsa.pub 或 id_dsa.pub文件

  1. 添加ssh key到github上
    (1)使用cat命令查看id_rsa.pub文件内容,并复制下来
    $ cat id_rsa.pub
    
    (2)登录github账户,点击右上角头像 - setting - SSH and GPG keys - New SSH key
    CentOS 7 下git clone配置使用
    (3)测试 SSH key
    ssh -T git@github.com
    
  2. git clone@git

使用类似如下命名下载(测试,请勿运行)文章来源地址https://www.toymoban.com/news/detail-455408.html

git clone git@github.com:openjdk/jdk

到了这里,关于CentOS 7 下git clone配置使用的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Centos7使用Nginx配置HTTPS正向代理

    Nginx默认安装只支持代理HTTP, 不支持代理 HTTPS, 如果需要支持HTTPS需要在Nginx编译时加入 ngx_http_proxy_connect_module. 从 ngx_http_proxy_connect_module 模块仓库下载源代码压缩包, 并确定支持的 Nginx 版本 仓库地址: https://github.com/chobits/ngx_http_proxy_connect_module/ 得到文件: ngx_http_proxy_connect_mo

    2024年04月26日
    浏览(25)
  • 「震惊」git error: Cloning into ‘‘... fatal: unable to access ‘https:……“

    最近在使用git,在使用git clone的时候出现了一些莫名其妙的问题,解决之后决定把它记录下来,方便git初学者。 1、问题描述 2、解决方法 1、问题描述 在git clone的时候出现如下问题: 2、解决方法 参考博文:git报错 fatal error 解决方法 产生原因:一般是这是因为服务器的SSL证

    2024年02月11日
    浏览(39)
  • git clone出现 fatal: unable to access ‘https://github.com/...‘的解决办法

    发生这种情况是因为代理是在git中配置的。既然它是https代理(而不是http)git config http.proxy和git config --global http.proxy也无济于事。 1、看看你的git配置 git config --global -l 如果你没有任何与https代理相关的内容,例如https_proxy = …问题不在这里。 如果您有与https代理相关的内容,

    2024年02月08日
    浏览(43)
  • 【已解决】git clone 失效,fatal: unable to access ‘https://github.com/XXX.git/‘: Recv failure: C

    问题: $ git clone https://github.com/d2-projects/d2-admin.git Cloning into ‘d2-admin’… fatal: unable to access ‘https://github.com/d2-projects/d2-admin.git/’: Recv failure: Connection was reset 解决方案: 先刷新DNS win+R, cmd 输入: 删除全局的 HTTP 代理设置,让 Git 回到直接连接状态 git config 用于配置 Git 的各种

    2024年02月08日
    浏览(51)
  • Git clone 出现 fatal: unable to access ‘https://github.com/n....‘ 的解决办法(亲自有效)

    如图所示,当我想要github上面的文件clone到本地的时候出现了这样的错误。  发生这样的错误是因为 Git 无法验证 GitHub 的 SSL 证书。这可能是由于本地的证书问题或网络问题导致的。 在 git clone 命令后面加上 -c 参数,并配置 Git 忽略 SSL 证书检查,如下所示: 这样就可以绕过

    2024年02月11日
    浏览(44)
  • 解决git clone或者pip install git+https://github.com/ruotianluo/meshed-memory-transformer.git出现的一系列问题

    出现的错误: 问题1. fatal: unable to access \\\'https://github.com/ruotianluo/meshed-memory-transformer.git/\\\': Failed to connect to github.com port 443 after 21020 ms: Timed out   error: unable to read sha1 file of m2transformer/data/example.py (d46c07fc2bb636146922425a46fbcbb2443407cf) 问题2. Collecting git+https://github.com/ruotianluo/meshed-memor

    2024年02月05日
    浏览(33)
  • 解决git clone时fatal: unable to access ‘https://gitee.com/XXX.git/‘: The requested returned error: 403

    今天想把一些项目的代码提交到git的时候,出现了‘https://gitee.com/XXX.git/‘: The requested returned error: 403 这个报错,然后我在网上找了些解决方法,最后是用这个方法解决的问题,原来我电脑的gitee之前不知道怎么配置的是上一家公司的gitee账号一直没有更改过来。 以下是更换

    2024年04月27日
    浏览(33)
  • 【Linux】git clone报错fatal: unable to access ‘https://github.com/xxx.git/‘: Encountered end of file

    目录 1、问题 2、解决 3、参考 git clone代码时突然报错...貌似时不时遇到这个问题,这次遇到了准备简单mark下 报错 fatal: unable to access \\\'https://github.com/xxx.git/\\\': Encountered end of file  将https改为http成功了,据说也可以改成git尝试(我改成git无用...) 原因不明,奇奇怪怪,ORZ 但其实

    2024年02月13日
    浏览(50)
  • 报错解决git clone --quiet https://github.com/facebookresearch/detectron2.git /tmp/pip-install-wdn8va

    在服务器上安装langchain+chatglm-6b的环境包requirements时遇到报错:  git clone --quiet https://github.com/facebookresearch/detectron2.git /tmp/pip-install-wdn8vazx/detectron2_09a41306c6a04abaa4ec763689775b94   fatal: unable to access \\\'https://github.com/facebookresearch/detectron2.git/\\\': Failed to connect to github.com port 443: Connection

    2024年02月04日
    浏览(33)
  • Git clone报错:fatal: unable to access ‘https://github.com/.....‘: Failed to connect to github.com port

    使用Git克隆项目是,有时候会报错:Failed to connect to github.com port 443 after 21096 ms: Couldn’t connect to server 原因是本机代理端口和git端口不一致。 我的解决方法: 然后开启手动代理模式: 随便在哪个地方,右键选择Git Bash Here(得安装了Git),然后在弹出的命令行窗口中分别输入一

    2024年04月13日
    浏览(55)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包