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.youkuaiyun.com/hudashi/article/details/45080721