我克隆了一个git repo,并在文件中看到了奇怪的文本。 HEAD<<<和>>>> [英] i cloned a git repo and see strange texts in files. HEAD <<< and >>>>>

查看:59
本文介绍了我克隆了一个git repo,并在文件中看到了奇怪的文本。 HEAD<<<和>>>>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我看到代码

 <<<<< HEAD 
公共功能login()
{
if($ this-> _identity === null){
$ this-> _identity = new UserIdentity($ this- >用户名,$ this->密码);
$ this-> _identity-> authenticate();
}
if($ this-> _identity-> errorCode === UserIdentity :: ERROR_NONE){
=======
/ **
*使用模型中给定的用户名和密码登录用户。
* @return boolean登录是否成功
* /
公共功能login()
{
if($ this-> _identity === null)
{
$ this-> _identity = new UserIdentity($ this->用户名,$ this->密码);
$ this-> _identity-> authenticate();
}
if($ this-> _identity-> errorCode === UserIdentity :: ERROR_NONE)
{
>>>>> > 6f9cd42a2926dccc612900c31769a977e71ed261
$ duration = $ this-> rememberMe吗? 3600 * 24 * 30:0; // 30天
Yii :: app()->用户->登录($ this-> _identity,$ duration);
返回true;
}
<<<<<< HEAD
否则返回false;
=======
否则
返回false;
>>>>> 6f9cd42a2926dccc612900c31769a977e71ed261
}
}

,我不知道这是什么意思。谁能解释?

解决方案

这表明不同版本之间存在冲突。



如果您实际上在已克隆的存储库中看到此错误,则表示有人搞砸了,因为在解决合并冲突时,他们提交了本应进行编辑的内容(选择正确的代码位之一)。 / p>

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 ?

解决方案

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.

这篇关于我克隆了一个git repo,并在文件中看到了奇怪的文本。 HEAD&lt;&lt;&lt;和&gt;&gt;&gt;&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆