zoukankan      html  css  js  c++  java
  • Git——报错总结

    前言

    git相关的报错汇总

    错误汇总

    上传文件需要密码

    问题原因

    1. 全局初始化是未添加邮箱
    2. 远程地址使用HTTPS 
    

    解决方案

    1.重新生成带有邮箱的公钥,并添加到平台 
    ssh-keygen -t rsa -C "xxxxx@xxxxx.com"
    2.删除原有的版本仓库,并使用SSH的地址重新添加远程仓库.
    $ git remote -v //查看远程仓库
    $ git remote remove xxx  //移除
    $ git remote add xx git@gitee.com:xxxxxxx/xxx.git //重新添加远程地址
    

    fatal: refusing to merge unrelated histories

    问题原因
    合并时报错提示拒绝合并不相关的历史

    解决方案

    git merge origin/src  --allow-unrelated-histories
    

    failed to push some refs to 'git@101.132.150.182:cpic/SCRM-Admin-Web.git'

    $ git push origin za:za
    To 101.132.150.182:cpic/SCRM-Admin-Web.git
     ! [rejected]        za -> za (non-fast-forward)
    error: failed to push some refs to 'git@<地址>:<仓库>.git'
    hint: Updates were rejected because the tip of your current branch is behind
    hint: its remote counterpart. Integrate the remote changes (e.g.
    hint: 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.
    

    问题原因

    本地仓库和远程仓库联系断开
    

    解决方法

    1. 使用-f强制推送(不推荐该方法)
    2. 拉取远程仓库到本地,重新建立 
      git pull <local-name> <remote-name>
      git add .
      git commit -m "xxx"
      git push <local-name> <local_branch_name>:<remote_branch_name>
    3. $ git branch --set--upstream-to=origin/<branch-name> <branch_name> (对我无效)
    
  • 相关阅读:
    侧滑的一个注意
    viewpager+fragment结合
    webview
    动画
    <context:annotation-config> 和 <context:component-scan>的区别
    spring mvc 原理及应用
    HDU
    使用Log4Net将系统日志信息记录到记事本和数据库中
    chromium for android GPU进程结构分析
    【云图】怎样制作全国KTV查询系统?
  • 原文地址:https://www.cnblogs.com/wangyang0210/p/12150353.html
Copyright © 2011-2022 走看看