Rock Mountain
  • Home
  • User Guide
    • Glass Web Components
    • Using reCAPTCHA
    • Publishing Source Code with Syntax Highlighting
  • Developer Guide
    • Getting Started
    • Adding NPM Packages
    • Database
      • Backing Up and Restoring Data
      • Database Schema
      • MongoDB Tips and Snippets
      • VS Code and the MongoDB Playground
    • Common Errors and Their Solutions
    • Developing Glass Web Components
    • DevOps
      • Build and Deployment Procedure
      • GitHub Conventions and Workflow
      • Merging Preview Into Main
    • File Structure
    • React Components
      • SiteLayout Component
      • Toggle Lazy Load Image Component
    • Update or Change the Fav Icon
    • References and Learning Resources
  • Icons
Powered by GitBook
On this page
  1. Developer Guide
  2. DevOps

Merging Preview Into Main

PreviousGitHub Conventions and WorkflowNextFile Structure

Last updated 3 years ago

For quick work, you can just promote the working preview build to production in Vercel using the Vercel Deployments UI.

Following is the proper way, however, to ensure that the main branch gets updated with the approved changes.

Fetch all the remote changes from GitHub and switch to .

git fetch origin
git checkout main
git pull

Now run the following command:

git merge preview

This will trigger some stuff in VS Code...

Under the Merge Changes section, you can right-click on items to determine what to do. Typically, that should be "Accept All Incoming" and then Save the file.

Then select all files under Merge Changes that you just resolved and select Stage changes.

Commit as "Merge branch preview into main vX.X.X"

Then push the changes up to the remote server.

TO DO: Rewrite this the command-line way. Don't want to depend on VS Code and visual tools for Git.