Git push代码的时候报错:
$ git push joe wechat2 Username for 'http://git.xxx.com': joe.le@xxx.com Password for 'http://joe.le@xxx.com@git.xxx.com': Counting objects: 428, done. Delta compression using up to 8 threads. Compressing objects: 100% (81/81), done. Writing objects: 100% (229/229), 9.98 MiB | 0 bytes/s, done. Total 229 (delta 173), reused 198 (delta 146) efrror: RPC failed; result=22, HTTP code = 413 atal: The remote end hung up unexpectedly fatal: The remote end hung up unexpectedly Everything up-to-date
搜索关键字:‘fatal: The remote end hung up unexpectedly’ 和 ‘efrror: RPC failed; result=22, HTTP code = 413’
说需要设置上传大小:
$ git config http.postBuffer 524288000
我这边的确也设置了,push的时候还是报这样的错。
搜索关键字:‘Delta compression using up to 8 threads’
说需要设置提交格式:
$ git config core.autocrlf true
我也去设置了,但是还是报错,最后给git管理员说明,说是需要设置ssh提交。
具体解决方案:
1、本机设置hosts对应服务器地址
192.168.1.1 git.xxx.com
2、生成ssh key关联到gitlab
$ ssh-keygen -t rsa -C “joe.le@xxx.com”按3个回车,密码为空。把 id_rsa.pub里面的内容添加ssh key到git上面。
3、重设http为git地址
$ git remote set-url joe git@git.xxx.com:joe.le/frontend.git
接着最后一次push成功,也不需要输入密码了。