小编Mis*_*ope的帖子

从原始仓库更新github fork

我找到了一些方法来从github上的原始repo更新fork(让我们说"jay"是原始repo的所有者的名字):

git remote add --track master jay git://github.com/jay/repo_name.git
git fetch jay
git merge jay/master
Run Code Online (Sandbox Code Playgroud)

好吧,它可以工作,但是在git pushgit发送大量数据之后我注意到我在github上的公共活动中做了大约500次提交,但实际上两个主分支之间的差异大约是8次提交.

那有什么不对?

更新:好吧,看起来我撒了谎.差异是几行代码,然而,作者以某种方式提取了大量的提交.也许它只影响了8个文件,这就是我认为8次提交的原因.

git merge github

6
推荐指数
1
解决办法
568
查看次数

Doctrine注释加载器失败

我正在尝试运行JMSSerializer.我的简单代码

use JMS\Serializer\Annotation\Type;

class Comment
{
    private $msg;

    public function __construct($msg)
    {
        $this->msg = $msg;
    }
}

class Person
{
    /**
     * @Type("array<Comment>")
     */
    private $commentList;

    public function addComment(Comment $comment)
    {
        $this->commentList[] = $comment;
    }
}

$type = new Type;
$serializer = JMS\Serializer\SerializerBuilder::create()->build();

$data = new Person();
$data->addComment(new Comment('hey'));

var_dump($serializer->serialize($data, 'json'));
Run Code Online (Sandbox Code Playgroud)

失败了

PHP Fatal error:  Uncaught exception 'Doctrine\Common\Annotations\AnnotationException' with message '[Semantical Error] The annotation "@JMS\Serializer\Annotation\Type" in property Person::$commentList does not exist, or could not be auto-loaded.' in xxx.php:52
Run Code Online (Sandbox Code Playgroud)

好的,但如果我添加线

$type …
Run Code Online (Sandbox Code Playgroud)

doctrine annotations jmsserializerbundle

2
推荐指数
1
解决办法
4668
查看次数

标签 统计

annotations ×1

doctrine ×1

git ×1

github ×1

jmsserializerbundle ×1

merge ×1