今天同事在使用git pull代码,碰到有冲突的情况,提示如下信息:
Please commit your changes or stash them before you merge.
Aborting
意思是说更新下来的内容和本地修改的内容有冲突,先提交你的改变或者先将本地修改暂时存储起来。
这个问题处理起来非常简单
1、先将本地修改存储起来git命令
$ git stash
这样本地的所有修改就都被暂时存储起来 。是用命令$git stash list可以看到保存的信息
2、pull内容
$ git pull
3、还原刚才暂时存储的内容
$ git stash pop stash@{0}
4、解决文件中冲突的的部分
function DeleteAccountInfoByUserId($userid)
{
try {
$this->em->createQueryBuilder()
<<<<<<< Updated upstream
->update('AppBundle:TDUserAccountInfo', 'a')
->set('a.status', 1)
->where('a.userId = :userId')
->setParameter('userId', $userid)
=======
->update('AppBundle:TDUserAccountInfo','a')
->set('a.status',1)
->where('a.user = :userId')
->setParameter('userId',$userid)
>>>>>>> Stashed changes
->getQuery()->execute();
return true;
} catch (Exception $e) {
return false;
}
}
具体怎么解决冲突,请百度