1、没有pull 就进行了commit 结果,导致文件内容冲突
The operation could not be performed because of one or more tree conflicts.
解决方法 :
-> 打开 终端
-> 不管是否成功都进行一次 git pull
-> git status // 查看一下冲突状态 ,如果想看日志等可以再使用命令 git show | head
-> 找到冲突文件进行手动更改。如果冲突比较大,建议使用soure tree等工具
-> git diff 可以查看具体冲突
-> 解决完冲突后,依次进入冲突文件的目录使用 cd xxxx/xxx
-> git add 冲突文件名 // 相当于标记为已解决冲突
-> 还是在当前目录下继续
-> git commit -i 冲突文件名 // (直接使用git commit 可能会报 : fatal: cannot do a partial commit during a merge.)
-> 全部解决完后,可以再次使用git status 等查看冲突。
-> git push 推到远程服务器