zoukankan      html  css  js  c++  java
  • Git错误汇总

    Git提示rejected

    To github.com:zhuxiaoxi/Web-Demo.git
    ! [rejected] master -> master (fetch first)
    error: failed to push some refs to 'git@github.com:zhuxiaoxi/Web-Demo.git'
    hint: Updates were rejected because the remote contains work that you do
    hint: not have locally. This is usually caused by another repository pushing
    hint: to the same ref. You may want to first integrate the remote changes
    hint: (e.g., 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.

    原因
    远程仓库有一部分代码已经被包含不允许直接推送到远程仓库

    解决方法

    • 在推送时,使用-f选项,强制推送
    git push origin master -f
    

    Git提示remote origin already exists

    fatal: remote origin already exists.

    原因
    已经设置了一个远程仓库,无法设置新的

    解决方法

    • 执行git remote rm origin,再修改远程仓库git remote add origin git@github.com:zhuxiaoxi/dotfiles.git

    Git提示fatal: refusing to merge unrelated histories

    git pull origin master
    From github.com:zhuxiaoxi/dotfiles

    • branch master -> FETCH_HEAD
      fatal: refusing to merge unrelated histories

    解决方法

    • 在拉取时,使用--allow-unrelated-histories选项,忽略无关的历史
    git pull origin master --allow-unrelated-histories
    

    Git提示Please make sure you have the correct access rights

    ssh: Could not resolve hostname origin: Name or service not known
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

    解决方法

    # git push origin:peppa 错误,修改为下面的
    git push origin :peppa
    
  • 相关阅读:
    (Eclipse) Selection does not contain main type
    Spring Web Flow 学习笔记(2)-流程的组件
    Spring Web Flow 学习笔记(1)
    快速排序java实现
    二路归并排序
    剪切板
    Java中空白final
    对象引用和对象
    Java复用类
    Experimenrs on Foursquare
  • 原文地址:https://www.cnblogs.com/zhuxiaoxi/p/8722852.html
Copyright © 2011-2022 走看看