zoukankan      html  css  js  c++  java
  • git处理时的问题

     1. 在node.js开发的时候常常会遇到从别人的远程仓库中clone时出现文件名过长的错误,

    或则是在本地npm下载之后的文件进行上传到自己的远程仓库的时候会出现 File too long的情况,这个时候(例如:mongoose的模块,less模块)

    可以在git bash中先运行下面这行命令:

         git config --global core.longpaths true,

    这样基本上可以解决问题。

      2. 如果对于非必要处理的文件文件可以利用.gitignore文件来忽略文件的上传到git远程仓库,

        具体介绍谷一下就行了,或则找一下度娘就解决。

      3. npm下载或遇到下载不下来的时候可以考虑淘宝镜像cnpm

        npm install -g cnpm --registry=https://registry.npm.taobao.org

      4. git提交的时候出现这种错误的时候:

      “If no other git process is currently running, this probably means a
      git process crashed in this repository earlier. Make sure no other git
      process is running and remove the file manually to continue.”

      解决方法:
        git bash 中输入:
    rm -f ./.git/index.lock

     5.git push 或者是 git pull 的时候出现下面报错

        Could not read from remote repository.

        Please make sure you have the correct access rights.and the repository exists.

        出现这个问题可能是因为,没有在github账号添加SSH key,或是因为重装系统等原因导致密钥与公钥丢失。需重新创建密钥与公钥

       解决方法:

          打开git bash(不可以是windows系统的cmd命令行):  ssh-keygen -t rsa -C "your_email@xxx.com"

          之后创建的三个回车,

          创建好后会默认在系统盘中创建一个公钥文件一般情况在 C:Users主机名.ssh 文件夹下有一个这个 id_rsa.pub 文件
          用记事本或者文本编辑器打开选中里面的所有内容  或者  命令行输入 pbcopy < ~/.ssh/id_rsa.pub 直接复制到剪切板上

          然后到自己的github中设置中添加SSH keys 





  • 相关阅读:
    [C++空间分配]new运算符、operator new、placement new的区别于联系
    [C++STL]stl源码剖析
    [C++基础]在构造函数内部调用构造函数
    Eclipse Memory Analyzer
    zookeeper 学习 zookeeper下载部署
    Doracle.jdbc.J2EE13Compliant=true
    zookeeper 学习 状态机复制的共识算法
    java -d
    轮盘选择法
    OPENJDK 源码编译
  • 原文地址:https://www.cnblogs.com/leexq/p/5045718.html
Copyright © 2011-2022 走看看