git失败解决办法
【报错场景一:git push】
1、 如果采用的是界面操作,报错如下:
git did not exit cleanly (exit code 1)
2、 如果采用的是git bash,命令行报错如下:
error: failed to push some refs to 'https://github.com/shiren1118/iOS_code_agile.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
解决办法1:
选中待push 的代码文件,鼠标右键唤出Git bash,键入命令:git push -u origin master -f
注意:黄色部分可根据实际情况进行更改为push代码的目标分支。
解决办法2:
push之前先pull一把最新代码,在工程根目录下执行git config http.postBuffer 524288000,将push的缓冲区设大一点,默认值比较小。
【报错场景二:git push】
error: RPC failed; result=22, HTTP code = 411或413fatal: The remote end hung up unexpectedly
或者
error: RPC failed; result=22, HTTP code = 501fatal: The remote end hung up unexpectedly
解决办法2:
push之前先pull一把最新代码,在工程根目录下执行git config http.postBuffer 524288000,将push的缓冲区设大一点,默认值比较小。
- 点赞
- 收藏
- 关注作者
评论(0)