美文网首页
定时任务,使用git pull 定时发布代码,代码冲突问题

定时任务,使用git pull 定时发布代码,代码冲突问题

作者: PHP的点滴 | 来源:发表于2019-12-23 13:50 被阅读0次

定时任务,使用git pull 定时发布代码,代码冲突问题

error: Your local changes to the following files would be overwritten by merge:
    modules/api/controllers/PaaaaaController.php
    modules/api/controllers/BaaaaaController.php
Please, commit your changes or stash them before you can merge.
Aborting
Updating 12470c3..6c141a2
----------------------------------------------------------------------------
★[2019-12-23 13:38:53] Successful
----------------------------------------------------------------------------

问题分析

这种情况一般有两种情况导致

  • 1.直接在服务器上修改代码导致版本冲突
    解决方法:
git stash
git pull
  • 2.文件权限的导致的问题,可能拉去代码的用户是 root账户,而web 程序运行的账户是 www用户,这样文件内容没有发生变化,而权限发生变化了
    解决方法
$ git config core.filemode false  // 当前版本库
$ git config --global core.filemode false // 所有版本库
$ git pull

相关文章

网友评论

      本文标题:定时任务,使用git pull 定时发布代码,代码冲突问题

      本文链接:https://www.haomeiwen.com/subject/lfpznctx.html