It sounds like you want to take an existing site with a Sage 8 theme + a custom plugin and use it with Trellis/Bedrock; I’d suggest creating a new repo, adding Trellis & Bedrock per https://roots.io/trellis/docs/installing-trellis/ then using the sub-tree merge on the Sage 8 repo. Keep the custom plugin separate and add it to your project via
composer.json. The gist you linked looks fine though I’m by no means an expert on sub-tree merging, but in the end you’d do something like this:
// From gist
$ mkdir new_parent_project
$ cd new_parent_project
$ git init
$ touch .gitignore
$ git commit -am "initial commit"
// Add Trellis
$ git clone --depth=1 email@example.com:roots/trellis.git && rm -rf trellis/.git
// Add Bedrock
$ git clone --depth=1 firstname.lastname@example.org:roots/bedrock.git site && rm -rf site/.git
// Merge theme repo per gist
$ git remote add -f sageRepo https://github.com/pathtosageRepo
$ git merge --allow-unrelated-histories -s ours --no-commit sageRepo/master
$ git read-tree --prefix=site/web/themes/sageRepo -u sageRepo/master
$ git commit -m "merging sageRepo into site/web/themes/sageRepo"
I would either fork the sage repo, and clone the fork, if you want to keep it as a sub-tree (see the “Pulling In Updates” section at the end of the gist) or delete the remote from the new project (
$ git remote remove sageRepo) once you’ve added it. Either way, that will let you avoid any changes to the originals. If you don’t fork the repo, and leave the remote, you could change the original (intentionally or otherwise) if you make changes and push them upstream.
As far as the plugin, see this blog post for how to make it accessible via composer: https://roots.io/wordpress-plugins-with-composer/