• GIT使用踩坑!!!我的妈妈呀,烦死了烦死了烦死了!!!


    问题1:Git:RPC failed;curl 56 OpenSSL SSL_read:Connection was reset,errno 10054

    原因:
    文件太大,上传失败
    方法:

    初始化:git init
    关闭远程:git config --global core.compression 0
    重新克隆:git clone url地址
    增大流量:git fetch --depth=2147483647
    提交代码:git pull --all
    
    • 1
    • 2
    • 3
    • 4
    • 5

    原答案:
    First, turn off compression:

    git config --global core.compression 0

    Next, let’s do a partial clone to truncate the amount of info coming down:

    git clone --depth 1

    When that works, go into the new directory and retrieve the rest of the clone:

    git fetch --unshallow

    or, alternately,

    git fetch --depth=2147483647

    Now, do a regular pull:

    git pull --all

    I think there is a glitch with msysgit in the 1.8.x versions that exacerbates these symptoms, so another option is to try with an earlier version of git (<= 1.8.3, I think).

    问题2:git:fatal:Unable to create"…/.git/index.lock

    原因:
    报错大致意思就是创建index.lock文件失败,因为已经存在index.lock文件了
    方法:

    命令删除:rm -rf .../.git/index.lock
    电脑直接搜索删除前提是必须先关闭GIT,否则不能直接删除
    
    index.lock作用:在进行某些比较费时的git操作时自动生成,操作结束后自动删除,相当于一个锁定文件,目的在于防止对一个目录同时进行多个操作。有时强制关闭进行中的git操作,这个文件没有被自动删除,之后你就无法进行其他操作,必须手动删除。
    
    • 1
    • 2
    • 3
    • 4

    问题3:提示warning: There are too many unreachable loose objects; run ‘git prune’ to remove them.

    原因:
    因为提交的改动过多,导致本地的缓冲区占用太大

    方法

    瘦身优化本地项目:git gc  --prune=now 
    
    • 1

    问题4:git 错误 Reinitialized existing Git repository

    原因
    没有原因,我也不知道原因,妈的!直接删除项目下的.git文件夹,重新拉项目吧

  • 相关阅读:
    CMU 15-445 Project 0 实现字典树
    物理层 (physical layer)
    Knife4j使用教程(二) -- 配置Swagger相关信息
    Spring中使用RabbitMQ
    2022年前端面试题目及知识点
    突破编程_C++_高级教程(正则表达式编程实例)
    二氧化钛纳米粒TIO2修饰多肽R8/CTT2/CCK8/GE11/cTAT/CPP/RVG29/SP94(无机纳米粒子偶联多肽)
    【SpringBoot】文件分片上传、合并
    Java---Maven详解
    【Vue-Element-UI -el-tree数据格式与组件中的格式不一样】
  • 原文地址:https://blog.csdn.net/qq_40320447/article/details/127899796