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

来源:互联网 发布:python小项目 编辑:程序博客网 时间:2024/06/05 22:43

《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的缓冲区设大一点,默认值比较小。

阅读全文
0 0