Website Development process

There are two branches, "main" and "develop"

The "main" one is the main site. When it is pushed, the site is automatically redeployed.

The "develop" goes to the "dev" version of the site. This gives us a live preview of what the site will be like.

To avoid a confusing edit history, we want "develop" and "main" to always share the same history, with "develop" having additional changes being previewed prior to merging. If we start merging "main" and "develop" back and forth we'll get spaghetti history and it'll be hard to keep track of which changes have been made, and where.

The process for making changes is:

  1. create a new branch off of main
    1. git checkout main
    2. git branch my-branch
    3. git checkout my-branch
  2. make changes and test locally on that branch
  3. check if "develop" is even with "main" (meaning, they should have the exact same commit)
    1. git show-ref main develop (the branches should all have the same commit hash)
    2. if "develop" is ahead of "main" then someone else is working on previewing/merging a change (they're on step 5), check in with them
  4. using git rebase, apply your commits to the "develop" branch (this re-applies the changes you made in your branch, onto the develop branch)
    1. git checkout develop
    2. git rebase <my-branch>
  5. push "develop" and confirm that the dev site is displaying properly, ask other people to review it, etc
  6. fast-forward "main" to match "develop"
    1. git checkout main
    2. git merge --ff-only develop
  7. Now you can push to main
    1. git push origin

Updated by Peter Amstutz over 1 year ago · 4 revisions