• GitHub上传文件问题总结


    问题一:git warning: LF will be replaced by CRLF in 解决办法

    在Git Bash中输入git add .时出现上述语句。

    解决办法:

    输入以下语句:

    $ git config core.autocrlf false

    ,这样设置git的配置后在执行add操作就没有问题了。

     

    问题二:On branch master nothing to commit, working tree clean

    在Git Bash中输入 git commit -m " " 时出现下列语句:

    On branch master nothing to commit, working tree clean

    On branch master nothing to commit, working tree clean

    含义是:项目没有被修改,不需要提交。也就是说:修改->add->修改->commit只能commit已经add的修改。

    问题解决:

    若要保存第二次修改需要再一次add然后commit

     

    问题三:fatal: could not open '.git/COMMIT_EDITMSG': Permission denied

    在Git Bash中输入 git commit -m " " 时出现下列语句:

    fatal: could not open '.git/COMMIT_EDITMSG': Permission denied

    解决办法:

    输入以下语句:

    $ chmod 664 COMMIT_EDITMSG

    问题四:fatal: the remote end hung up unexpectedly

    在输入git push origin master之后出现fatal: the remote end hung up unexpectedly ,表示上传文件太大,导致上传失败。

    解决办法:

    参考博客:https://www.cnblogs.com/hanxianlong/p/3464224.html

    问题五:fatal: refusing to merge unrelated histories

    在输入下拉语句 git pull origin master之后出现fatal: refusing to merge unrelated histories,这个问题是因为这是两个不想干的Git库,一个是本地库,一个是远端库,然后本地与远端不相干,所以告知无法合并。

    解决办法:

    使用强制方法:

    git pull origin master --allow-unrelated-histories

    后面加上 --allow-unrelated-histories ,参数的意思是合并仓库的时候,允许不相关的历史的提交内容,后面再push就可以了 。

  • 相关阅读:
    div 垂直居中的方法
    vs code添加到鼠标右键
    win10系统迁移到新的硬盘
    使用layui iframe弹层,各弹层之前的传值问题
    layui js动态添加的面板不能折叠
    Nginx系列6:对称加密与非对称加密各自的应用场景
    Nginx系列5:从网络原理来看SSL安全协议
    Nginx系列0:Nginx学习历程
    加扰与加密&解扰与解密
    微信小程序学习过程
  • 原文地址:https://www.cnblogs.com/ST-2017/p/10430612.html
Copyright © 2020-2023  润新知