Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingluddite/c896dbf1858bd8015a625406519a9e04 to your computer and use it in GitHub Desktop.
Save kingluddite/c896dbf1858bd8015a625406519a9e04 to your computer and use it in GitHub Desktop.
How to create different build commands per branch

Yes, in Netlify, you can indeed have different build commands per branch. This capability is particularly useful when you want to run different build processes or deploy different versions of your site depending on the branch you're working on.

Here's how you can set up different build commands per branch in Netlify:

  1. Navigate to your site settings: Log in to your Netlify account and select the site you want to configure.

  2. Go to Build & deploy settings: Once you're in the site dashboard, find the "Settings" option and click on "Build & deploy" settings.

  3. Configure build settings for each branch: Scroll down until you find the section titled "Branches". Here, you'll see a list of your branches. Click on the branch for which you want to set a custom build command.

  4. Set the build command: In the settings for the specific branch, you'll find an option to set a custom build command. Enter the command you want Netlify to run when building that specific branch.

  5. Save your changes: After setting the custom build command, make sure to save your changes.

By configuring different build commands per branch, you can customize your deployment workflow to suit the needs of each branch. This flexibility allows you to test changes, experiment with new features, and manage your development process more efficiently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment