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

 

转载于:https://www.cnblogs.com/effortsing/p/10012173.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值