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
  • 相关阅读:
    java 多线程
    构造N位格雷码(递归,面向对象)
    字典树trie
    快速排序
    C++ 链表
    15-谜问题(深拷贝、LC检索、面向对象编程)
    [编程题] 扫描透镜(本题还涉及如何从字符串中提取数字)
    python爬虫提取冰与火之歌五季的种子
    带有限期和效益的单位时间的作业排序贪心算法
    0/1背包问题与动态规划
  • 原文地址:https://www.cnblogs.com/effortsing/p/10012173.html
Copyright © 2011-2022 走看看