i cloned a git repo and see strange texts in files. HEAD <<< and >>>>>

点点圈 提交于 2019-12-30 10:33:18

问题


For example i see code

<<<<<<< HEAD
    public function login()
    {
        if($this->_identity===null) {
            $this->_identity=new UserIdentity($this->username,$this->password);
            $this->_identity->authenticate();
        }
        if($this->_identity->errorCode===UserIdentity::ERROR_NONE) {
=======
    /**
     * Logs in the user using the given username and password in the model.
     * @return boolean whether login is successful
     */
    public function login()
    {
        if($this->_identity===null)
        {
            $this->_identity=new UserIdentity($this->username,$this->password);
            $this->_identity->authenticate();
        }
        if($this->_identity->errorCode===UserIdentity::ERROR_NONE)
        {
>>>>>>> 6f9cd42a2926dccc612900c31769a977e71ed261
            $duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days
            Yii::app()->user->login($this->_identity,$duration);
            return true;
        }
<<<<<<< HEAD
        else return false;
=======
        else
        return false;
>>>>>>> 6f9cd42a2926dccc612900c31769a977e71ed261
    }
}

and i didn't know what it means. Can anyone explain ?


回答1:


It's indicating a conflict between different versions.

If you actually see this in a repository that has been cloned then someone has screwed up, because they have committed something which should have been edited (to choose one of the correct bits of code) when they were resolving a merge conflict.



来源:https://stackoverflow.com/questions/5988610/i-cloned-a-git-repo-and-see-strange-texts-in-files-head-and

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