《GIT push操作报错git did not exit cleanly (exit code 1)及对应解决方案》

《GIT push操作报错及对应解决方案总结》


    【报错场景一: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 
                注意: 代码分支"master" 可根据实际情况进行更改为push代码的目标分支。
         解决办法2:

                push之前先pull一把最新代码,在工程根目录下执行git config http.postBuffer 524288000,将push的缓冲区设大一点,默认值比较小。

【特别说明】有任何疑问,请扫描二维码提问:

《GIT push操作报错git did not exit cleanly (exit code 1)及对应解决方案》_第1张图片

你可能感兴趣的:(Git)