git pull与clone正常但是push的时候返回:
error: RPC failed; HTTP 401 curl 22 The requested URL returned error: 401
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
通过搜索从大量重复的博客中总结出了几个原因
1.我遇到的是账号密码错误,但是是因为密码末尾是"."这个特殊符号导致的,因为命令行模式是通过url请求的方式,如果是程序可以通过urlencode进行处理 也可以通过
//清除账号密码缓存
git config --system --unset credential.helper
git push
或者直接修改.git/config里的
[remote "origin"]
url = http://git.xx.com:8818/user/repo
改为
url = http://user:passwd@git.xx.com:8818/user/repo
参考文章 https://blog.csdn.net/qq_42685333/article/details/83095869
2.在站点里添加对应用户的read与writ权限即可
3.将保护分支的选项去掉就能推送了
4.还有一个是修改
单独项目设置:
git config http.postBuffer 1024000000
全局设置:
git config --global http.postBuffer 1024000000
不过这个对应的错误为error: RPC failed; result=22 HTTP code = 413在此做个记录
加载更多