Skip to content

Instantly share code, notes, and snippets.

@Oldenborg
Oldenborg / AssertJson.php
Last active October 2, 2023 22:50
Laravel test trait: assert JSON exact
<?php
namespace Tests\Traits;
use Illuminate\Testing\TestResponse;
use Illuminate\Support\Arr;
use PHPUnit\Framework\Assert as PHPUnit;
trait AssertJson
{

Subtree merges

This is an alternative to submodules:

This gives us a way to have a workflow somewhat similar to the submodule workflow without using submodules (which we will cover in Submodules). We can keep branches with other related projects in our repository and subtree merge them into our project occasionally. It is nice in some ways, for example all the code is committed to a single place. However, it has other drawbacks in that it’s a bit more complex and easier to make mistakes in reintegrating changes or accidentally pushing a branch into an unrelated repository.

Say you want to merge repository a into b. This can be accomplished with one command:

git subtree add --prefix=a ../a master