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 -->enter
[注意]代码分支"master" 可根据实际情况进行更改为push代码的目标分支

解决办法2

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

你可能感兴趣的:(git,github)