zoukankan      html  css  js  c++  java
  • git_push报错

    转自   https://blog.csdn.net/u010042585/article/details/79378726
    
    
    将本地项目push到GitHub时遇到的问题
    
    1、$ git remote add origin时出现fatal: remote origin already exists.错误
    只要执行一下git remote rm origin  在执行git remote add origin  就可以啦
    
    
    2、执行git push -u origin master(使用的时HTTPS连接,没有验证SSH连接)时出现remote: Invalid username or password.
    fatal: Authentication failed for 'https://github.com问题解决办法:
    在输入Username for 'https://github.com': XXX 后弹出的窗口需要输入密码,这个密码不是GitHub登录密码而是gitab 的访问令牌
    
    
    
    
    3、$ git push -u origin master
    fatal: HttpRequestException encountered.
     
    Username for 'https://github.com':
    To https://github.com/
    ! [rejected] master -> master (fetch first)
    error: failed to push some refs to
    错误解决办法
    执行一下:git pull --rebase origin master
    
    
    
    
    4、
    
    [root@node2 learngit]# git push origin master
    To http://192.168.0.74:9675/zihao/test.git
     ! [rejected]        master -> master (fetch first)
    error: failed to push some refs to 'http://192.168.0.74:9675/zihao/test.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 merge the remote changes (e.g.,
    hint: 'git pull') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.
    
    
    
    解决:
    
    先pul 再push
    
    [root@node2 learngit]#git pull http://192.168.0.74:9675/zihao/test.git
    [root@node2 learngit]# git push origin master
  • 相关阅读:
    .NET Framework 1.13.5 版本安装包下载链接
    可遇不可求的Question之MYSQL获取自增ID的四种方法篇
    20110917 晴
    北海道 7天6夜 自助游
    想你了
    猫忘带电话了
    [转载经验] 探亲签证申请
    帮忙打印
    打印机
    20110910 晴
  • 原文地址:https://www.cnblogs.com/effortsing/p/10012173.html
Copyright © 2011-2022 走看看