码迷,mamicode.com
首页 > 其他好文 > 详细

git did not exit cleanly (exit code 1) 的解决办法

时间:2019-12-13 19:16:36      阅读:465      评论:0      收藏:0      [点我收藏+]

标签:--help   解决办法   ESS   很多   题解   eject   内容   rate   rem   

问题描述:

    关于Git的使用,在通常情况下,习惯于先在本地创建一个本地仓库,然后将项目提交到本地master,再将本地master中的项目Push 到远程仓库中,这样问题就来了。

具体错误信息如下:

git.exe push --progress "origin" master


To https://github.com/Jackson-AndyLau/CMSManager.git
! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to ‘https://github.com/Jackson-AndyLau/CMSManager.git‘
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: ‘git pull ...‘) before pushing again.
hint: See the ‘Note about fast-forwards‘ in ‘git push --help‘ for details.

 


git did not exit cleanly (exit code 1) (12359 ms @ 2018-07-01 09:41:24)

 

如下图所示:

 

 

 

 

 

解决办法:

    关于这个问题,在网上搜罗了一下,很多工程师都遇到过,解决方法也是五花八门,要不删除一些文件,要不修改一些配置文件,但最终还是未能解决问题。

    后来经过多次的尝试,终于找到了解决办法,这儿分享出来,希望能帮助到你,能少花费些时间去看那些无用的方法!!!

1、根据错误内容提示,先将远程新建的空仓库 “ Clone ” 到本地,会得到一个空的与远程仓库对应的目录,如下图:

 

 

2、然后将文件提交到master,再Push到远程仓库,发现问题解决了额, 如下图:

 

 

再看远程仓库:

 


————————————————
版权声明:本文为CSDN博主「csdn-华仔」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/hello_world_qwp/article/details/80872257

git did not exit cleanly (exit code 1) 的解决办法

标签:--help   解决办法   ESS   很多   题解   eject   内容   rate   rem   

原文地址:https://www.cnblogs.com/zhuawang/p/12036757.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!