Support Forums

Deploy a second branch

Hello, I’m super new to Netlify and web development in general so I’m pretty sure my problem is user error. I’d so appreciate it if someone can help me!

I deployed a site to Netlify without any issues, I am using the Github method and thank you guys for making the docs amazing. But then I have two branches, “main” and “claimBudsSandbox”.

In my settings - build and deploy, I selected “Deploy all branches pushed to the repository”.
I read in the docs that if I have another branch, I can just access it by adding the branch name to the front or the url…

My site url on Netlify: https://claimbuds.netlify.app/
URL I tried: https://claimbudssandbox-claimbuds.netlify.app/

I got this error: Not Found - Request ID: 01FHXJK18KB0PBXHG7H3DE9448

Can someone please tell me where I broke something? Lol. I’m 99% sure it’s me that did something I wasn’t supposed to. Thanks for the help!

Hi @derekryansnzy

Have you built & deployed the second branch yet?

I tried to do that as a new site but it failed, so I thought maybe it was deployed along with the main repo?

Deploys are separate for each branch. Committing to one doesn’t trigger a build on all. Have a read over

I read the docs before and this is the part that says if all my branches are selected, they should deploy:
“Once you select some or all of your branches for branch deploys, Netlify will start watching those branches for new commits and pull/merge requests. As soon as you start pushing changes to those branches, you’ll find new deploys for those branches.”

My settings in build and deploy is to select all branches. Should I change it to something else?

If you make a commit to your second branch (even changing the README.md) you should see Netlify building that branch immediately if you have everything configured correctly.

You should see on the deploys page for your site (https://app.netlify.com/sites/claimbuds/deploys) a listing for your branch

Screen Shot 2021-10-14 at 8.58.35 am

Like I said, it’s probably human error and I messed up the setting somewhere. I tried making a commit and in the deploy page it shows that the deploy was canceled.
Here’s the log:

6:06:03 PM: Build ready to start
6:06:05 PM: build-image version: 3bcb38c35508b42e9121d4badfe6d8c66fd7a3f0
6:06:05 PM: build-image tag: v4.3.2
6:06:05 PM: buildbot version: 04fb57a6b52e36fc0fd306c97e17aa22ebf93b50
6:06:06 PM: Fetching cached dependencies
6:06:06 PM: Starting to download cache of 137.5MB
6:06:07 PM: Finished downloading cache in 1.460209161s
6:06:07 PM: Starting to extract cache
6:06:11 PM: Finished extracting cache in 4.330024306s
6:06:11 PM: Finished fetching cache in 5.845148432s
6:06:11 PM: Starting to prepare the repo for build
6:06:12 PM: Preparing Git Reference refs/heads/claimBudsSandbox
6:06:12 PM: Parsing package.json dependencies
6:06:13 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'CareBuds Dapp' versus '' in the Netlify UI
6:06:13 PM: No changes detected in base directory. Returning early from build.
6:06:13 PM: Creating deploy upload records
6:06:13 PM: Failed during stage 'checking build content for changes': Canceled build due to no content change
6:06:13 PM: Finished processing build request in 7.564061268s

Because there are no changes in content compared to what was previously built/deployed.

Does the deploys page for your site list any Branch Deploy items (as in image previously posted)?

If so, clicking the text Branch Deploy will open the branch in a new tab.

Here is a main site: https://astro-users-demo.netlify.app
Here is a branch deploy: https://global-fetch–astro-users-demo.netlify.app

This is what my deploy page looks like:

I don’t think the second branch was ever deployed and I am confused on how to do it. Thanks for your patience in helping me with this issue!

The good thing is Netlify is picking up your branch and building. But as per the error, there were no changes in content, so the build was cancelled. If you make a change to one (or more) of the content pages or other file it should then build that. (For example, I changed the footer component in my branch which is included on all pages.)

I changed the index.html file, I tried using pull request in Github, cleared cache a couple times and redeployed. Same thing…maybe it’s a Github issue?

Without seeing all your settings, GitHub, etc. I could probably only make guesses.

Here’s a repository: coelmay/netlify-branch-demo

I deployed the main branch to: frosty-easley-3e6c36.

Next, I created a new branch on demo-1 my computer (I am using GitHub Desktop) and pushed this to GitHub. As I hadn’t enabled branch deploys, this was not automatically picked up by Netlify. I adjusted the branch settings to Deploy all branches pushed to the repository.

So next, I modified the index.html, pushed, and Netlify deployed this branch: demo-1–frosty-easley-3e6c36.

Then, I repeated the previous step of creating a new branch demo-2 which upon pushing to GitHub, Netlify automatically picked up this branch and deploy it to demo-2–frosty-easley-3e6c36.

Edit: Forgot screenshot: