Repo only contains contents of 'site' directory

I’m following this great tutorial on Trellis but getting this error:

repo subtree is set to 'site' but that path does not exist in the repo. Edit
`repo_subtree_path` for '' in `wordpress_sites.yml`.
fatal: []: FAILED! => {"changed": false, "failed": true}

When I look at my repo, it only contains the contents of the ‘site’ directory. So there is no ‘site’ directory.

When I look at the Roots Example Project repo it has the ‘site’ and ‘trellis’ folders there. Have I done something wrong deploying to git?

Both that tutorial and roots-example-project require you to have a repo that looks like this:      # → Root folder for the project
├── trellis/      # → System management & deployment
└── site/         # → A Bedrock-based WordPress site
    └── web/
        ├── app/  # → WordPress content directory (themes, plugins, etc.)
        └── wp/   # → WordPress core (don't touch!)
1 Like

So do I need to do my first push to Github from the directory? The tutorial says from the site directory.

Yes, that should be the root of your Git repo. You should see the site and trellis folders on GitHub if it’s correct.

So I’m putting in these commands:

cd ~/sites/ git init git add . git commit -m "First commit" git remote add origin git push origin master

And it just pushes the contents of my site folder, not the site + ansible folders to GitHub… what’s going wrong?

I get Counting objects: 3231, done. instead of 3 like in the example.

Managed to get those two folders up into the repo now but deploying is stuck on TASK [deploy : Reload php-fpm]

Feels like every time I fix one thing with this deployment something else goes wrong. This is unrelated, right?

You clearly showed just now that you did a git init in the site folder. Of course it’s going to be missing the Trellis (Ansible) folder.

You are not following the instructions to setup a Trellis project.

You need to go back and look at the Trellis/roots-example-project README files and project documentation, follow the steps, and you will get up and running.

I just noticed in your OP you mentioned that you’re using a different, outdated tutorial to get up and running with Trellis.