Git使用中出现的错误以及解决办法积累

末鹿安然 提交于 2019-12-01 17:24:24

1.问题情境:昨晚上在上传代码的时候,commit代码以后没有进行push就放在那里,今天修改了新的模块以后,上传代码时出现了如下错误:

commit is not possible because you have unmerged files

hint: Fix them up in the work tree,
hint: and then use 'git add/rm <file>' as
hint: appropriate to mark resolution and make a commit,
hint: or use 'git commit -a'.
fatal: Exiting because of an unresolved conflict.

原因分析:新修改功能后的文件与原来commit未push的文件存在冲突,需要将修改后的文件手动加入到文件push队列中。

解决办法: 使用git add [filename] 将差异文件添加进去。也可以先使用git status (git status命令可以列出当前目录所有还没有被git管理的文件和被git管理且被修改但还未提交(git commit)的文件.)查看差异文件,然后按照自己的需求进行操作。

关于git status 参考:http://blog.csdn.net/hudashi/article/details/45080721

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!