Installing Roots Theme and keeping it up to date (or any starter theme)

I wanted to share how I managed to install Roots Starter Theme via Bedrock/Composer, by cloning the roots/roots github repository and automatically branch it so you can customize it and still be able to update it.

The below composer code does:

  1. git clone roots giithub repo to themes/mytheme folder
  2. create a branch called 7.0.1 you can start editing (rename it if you like)

By cloning roots repo, this allows to later update your branch with the latests commits done to master with git rebranch.

I’ve just started learning git yesterday so let me know if this is overkill. I just like the idea of being able to make my themes keep up with the updates. I’m curious to know what you think of this approach for roots instead of using packages.

Also look like less breakable than using child themes… hopefully!

in composer.json

{
         "repositories": [
	{
		"type": "package",
		"package": {
			"name": "roots/mytheme",
			"type": "wordpress-theme",
			"version": "7.0.1",
			"source": 	{
				"type": "git",
				"url": "https://github.com/roots/roots.git",
				"reference": "master"	
			},
			"require": {
				"fancyguy/webroot-installer": "1.1.0"
			}
		}
	}
  ],
  "require": {
    "roots/mytheme":"7.0.1"
  }