Staging and Production on same VPS

Awesome that your setting up a good workflow! The good news is that these concepts are global – not roots/trellis specific – so you’ll find a ton of info by googling around.

The basic idea is…

  1. clone trellis repo to your dev machine (I’d leave the .git folder there)
  2. add bitbucket as a “remote” (e.g., named “origin”)
  3. add the official roots/trellis as a “remote” (e.g., named “upstream”)

Now you can push/pull changes to the “origin” remote (your private bitbucket repo). You can pull updates from the “upstream” remote (the roots official repo).

As changes are made to the official “upstream” repo, I’d just “merge” them so your git history shows a timeline with your changes intermingled with the official changes over time (i.e., providing temporal context). Alternatively, you could “rebase” your changes on top of “upstream” master, making all your customizations appear lumped together at the end of the git history.

If I planned making customizations over the long term, I’d use the merge strategy, so that the git history would show my changes in temporal context. If I were doing just one time-delimited round of customizations, then I’d rebase them on top of “upstream” master. Others may do differently.

This approach starts at bitbucket, automatically adding the bitbucket “origin” remote.

Create private fork. Log in to bitbucket then go to https://bitbucket.org/repo/import

Create local copy. Edit with your bitbucket username.

  • git clone git@bitbucket.org:username/my-trellis.git
  • cd my-trellis
  • git remote add upstream https://github.com/roots/trellis.git
  • git remote -v

Then start editing and customizing.

6 Likes