Xano Documentation
  • 👋Welcome to Xano!
  • 🌟Frequently Asked Questions
  • 🔐Security & Compliance (Trust Center)
  • 🙏Feature Requests
  • 💔Known Issues
  • Before You Begin
    • Using These Docs
    • Where should I start?
    • Set Up a Free Xano Account
    • Key Concepts
    • The Development Life Cycle
    • Navigating Xano
    • Plans & Pricing
  • The Database
    • Designing your Database
    • Database Basics
      • Using the Xano Database
      • Field Types
      • Relationships
      • Database Views
      • Export and Sharing
      • Data Sources
    • Migrating your Data
      • Airtable to Xano
      • Supabase to Xano
      • CSV Import & Export
    • Database Performance and Maintenance
      • Storage
      • Indexing
      • Maintenance
      • Schema Versioning
  • 🛠️The Function Stack
    • Building with Visual Development
      • APIs
        • Swagger (OpenAPI Documentation)
      • Custom Functions
        • Async Functions
      • Background Tasks
      • Triggers
      • Middleware
      • Configuring Expressions
      • Working with Data
    • Functions
      • AI Tools
      • Database Requests
        • Query All Records
          • External Filtering Examples
        • Get Record
        • Add Record
        • Edit Record
        • Add or Edit Record
        • Patch Record
        • Delete Record
        • Bulk Operations
        • Database Transaction
        • External Database Query
        • Direct Database Query
        • Get Database Schema
      • Data Manipulation
        • Create Variable
        • Update Variable
        • Conditional
        • Switch
        • Loops
        • Math
        • Arrays
        • Objects
        • Text
      • Security
      • APIs & Lambdas
        • Realtime Functions
        • External API Request
        • Lambda Functions
      • Data Caching (Redis)
      • Custom Functions
      • Utility Functions
      • File Storage
      • Cloud Services
    • Filters
      • Manipulation
      • Math
      • Timestamp
      • Text
      • Array
      • Transform
      • Conversion
      • Comparison
      • Security
    • Data Types
      • Text
      • Expression
      • Array
      • Object
      • Integer
      • Decimal
      • Boolean
      • Timestamp
      • Null
    • Environment Variables
    • Additional Features
      • Response Caching
  • Testing and Debugging
    • Testing and Debugging Function Stacks
    • Unit Tests
    • Test Suites
  • CI/CD
  • File Storage
    • File Storage in Xano
    • Private File Storage
  • Realtime
    • Realtime in Xano
    • Channel Permissions
    • Realtime in Webflow
  • Maintenance, Monitoring, and Logging
    • Statement Explorer
    • Request History
    • Instance Dashboard
      • Memory Usage
  • Building Backend Features
    • User Authentication & User Data
      • Separating User Data
      • Restricting Access (RBAC)
      • OAuth (SSO)
    • Webhooks
    • Messaging
    • Emails
    • Custom Report Generation
    • Fuzzy Search
    • Chatbots
  • Xano Features
    • Snippets
    • Instance Settings
      • Release Track Preferences
      • Static IP (Outgoing)
      • Change Server Region
      • Direct Database Connector
      • Backup and Restore
      • Security Policy
    • Advanced Back-end Features
      • Xano Link
      • Developer API (Deprecated)
    • Metadata API
      • Master Metadata API
      • Tables and Schema
      • Content
      • Search
      • File
      • Request History
      • Workspace Import and Export
      • Token Scopes Reference
  • Xano AI
    • Building a Backend Using AI
    • Get Started Assistant
    • AI Database Assistant
    • AI Lambda Assistant
    • AI SQL Assistant
    • API Request Assistant
    • Template Engine
    • Streaming APIs
  • AI Tools
    • MCP Servers
      • Connecting Clients
      • MCP Functions
  • Xano Transform
    • Using Xano Transform
  • Xano Actions
    • What are Actions?
    • Browse Actions
  • Team Collaboration
    • Realtime Collaboration
    • Managing Team Members
    • Branching & Merging
    • Role-based Access Control (RBAC)
  • Agencies
    • Xano for Agencies
    • Agency Features
      • Agency Dashboard
      • Client Invite
      • Transfer Ownership
      • Agency Profile
      • Commission
      • Private Marketplace
  • Enterprise
    • Xano for Enterprise
    • Enterprise Features
      • Microservices
      • Tenant Center
      • Compliance Center
      • Security Policy
      • Instance Activity
      • Deployment
      • RBAC (Role-based Access Control)
      • Xano Link
  • Your Xano Account
    • Account Page
    • Billing
    • Referrals & Commissions
  • Troubleshooting & Support
    • Error Reference
    • Troubleshooting Performance
      • When a single workflow feels slow
      • When everything feels slow
      • RAM Usage
      • Function Stack Performance
    • Getting Help
      • Granting Access
      • Community Code of Conduct
      • Community Content Modification Policy
  • Special Pricing
    • Students & Education
    • Non-Profits
  • Security
    • Best Practices
Powered by GitBook
On this page
  • Create a New Branch
  • Change which Branch to Edit and Set Live
  • Know if the Branch you're editing is Live or not
  • Compare Differences (Compare Branches)
  • How to compare branches
  • Merging
  • How to Merge
  • Dealing with Merge Conflicts
  • Workspace Triggers
  • Restoring a Branch Backup

Was this helpful?

  1. Team Collaboration

Branching & Merging

Last updated 2 months ago

Was this helpful?

A Branch is a copy of a workspace's business logic (APIs, Functions, Addons, and Tasks). They are most useful for testing and developing new versions of your app without affecting your customers' primary experience.

You can create new Branches and select which Branch to make a copy of, choose which Branch to make edits to, and select which Branch you want to be live for your API.

Branches can also from a source Branch to a destination Branch to make managing development, test, and live environments as seamless as ever.

Your initial Branch will be considered v1 of your business logic. Below your workspace name, you will be able to identify which Branch you are currently editing.

Create a New Branch

Select the Branch identifier located underneath the workspace name.

This will allow you to see and change which Branch you are currently editing and which is live for your users, and allow you to add a new Branch.

When you select Add new Branch you will be able to choose a source Branch to make a copy from, the name of your new Branch, set a color, and add a description.

The color you select will be reflected in different elements of the Xano UI to represent and easily inform which branch you are currently working on.

Adding a new Branch makes a copy of the source Branch at that given time. So for example, if you create v2 from source Branch v1, you will have all the same business logic (APIs, Functions, Addons, and Tasks).

Change which Branch to Edit and Set Live

The Branch you are currently editing will be identified underneath the workspace name on the left menu column and in the top banner.

To change which branch you are editing, click on the Branch name to open up the menu of the different Branches in your workspace.

Select a Branch you wish to edit or set live and you will have the option to do so.

When a Branch is set live, it is the Branch or version of your API endpoints and business logic that will be live for your users.

If you wish to call an API endpoint from a Branch that is not live, you can do so by adding the branch name after the canonical, for example:

If the live branch is:

https://xb17-511e-40b9.xano.io/api:b4afb8/tutorial

You can access a different branch by adding :branch name after the canonical:

https://xb17-511e-40b9.xano.io/api:b4afb8:v2/tutorial
X-Branch: v2

Setting this on an API endpoint would force that endpoint to call the v2 Branch version of the endpoint.

Know if the Branch you're editing is Live or not

While making changes in your workspace, you can differentiate if your Branch is live or not with the banner at the top of the UI all across Xano.

When editing a branch that isn't live, you will be presented with a banner such as the one below.

When editing a Branch that is not live, the Swagger documentation and API Endpoint URL buttons will provide the version of that Branch and not the live Branch.

To get the URL of the live Branch either remove the :branch name after the canonical or go to the live Branch.

Compare Differences (Compare Branches)

How to compare branches

To compare branches, select Compare Branches from the branches menu.

Step 1 - Select the branch to compare from

First, select the branch to compare from. This is considered the source branch.

Step 2 - Select the destination branch to compare to.

Next, select the destination branch to compare to. If you were to merge, this is the branch to merge into.

Comparing mode will not commit to a merge, it's an opportunity to see and compare differences between the branches. You will only merge by selecting the merge option on the branches menu.

Compare Branches

Lastly, the difference comparison opens showing everything that could merge into the destination branch and highlighting if anything is new or has changed.

Furthermore, selecting a new or changed item allows you to see a snapshot of the item for context into exactly what the new item contains or what has changed compared to the existing item.

Changes

Changes are accompanied by a number in parentheses. This number identifies how many changes there are compared to the existing item in the destination branch.

By selecting changes next to the item, a snapshot opens showing exactly what the differences and changes are.

In the above screenshot we can see the six changes:

  1. created_at input deleted.

  2. name input edited.

  3. category input edited.

  4. value input edited.

  5. API Request added.

  6. Create Variable added.

New

You can also see a snapshot of a new item. Everything in the item will be considered as added but it's insightful context for you to understand what you may be merging into another branch.

Merging

Merging Branches allows for seamless development management of different environments. It allows you to update a destination Branch with changes and updates created from a source Branch. Merging will include changes to published objects such as APIs, Functions, Addons, and Tasks, and newly created ones.

For example, your live Branch is v1. You are editing v2, which has some new API endpoints for a new feature you are rolling out. During the development phase of v2, you had to modify an API endpoint in v1. When you're ready to merge v2 into v1, Xano will add the new API endpoints from v2 and maintain the update to the API endpoint on the destination v1 Branch.

How to Merge

To merge Branches open the Branches menu by selecting the Branch name under the Workspace name in the left-hand navigation bar.

Next, select Merge Branches.

After selecting Merge Branches, Xano will ask you to select the source Branch.

The Source Branch is the Branch containing the updates and modifications that you want to merge into the Destination Branch.

Next, select the Destination Branch to merge the changes from the Source Branch. You can also choose if you would like the destination branch to be backed up prior to the merge.

The Destination Branch is the Branch where the updates will be merged into.

Then, Xano will display a confirmation page with all the Workspace objects receiving updates or new items.

If there is a change you do not want to include in the merge, select the settings icon next to the Workspace object and deselect the change to remove it from the merge.

Once satisfied with all the updates included in the merge select publish to merge the Branches.

Dealing with Merge Conflicts

1

Compare the differences between the branches to see where the conflict lies

2

If you receive a merge conflict notice but there is no apparent conflict, you might have a function stack with the same name, but a different GUID.

If you aren't sure updating the GUID is necessary in your situation, please reach out to support before proceeding.

Head to the settings of the function stack and choose Security.

You can update the GUID in the destination branch to match the function stack of the same name from the source branch

Workspace Triggers

From your workspace settings, you have the option to enable triggers based on certain events.

  • Branch Live - Any time a branch status is set to live

  • Branch Merge - When a branch is merged

  • Branch New - When a new branch is created

From your Dashboard, access the menu from the top-right corner, and choose Triggers.

Choose 'Add Workspace Trigger' and provide the requested information. In the example below, we are creating a trigger called My Workspace Trigger that will run anytime a branch merge takes place, or a new branch is created.

Your Workspace Trigger will have three inputs defined. Inputs for triggers can not be modified.

  • to_branch - Information regarding the destination branch

  • from_branch - Information regarding the source branch

  • action - The action taking place

Now that your trigger is set up, you can build a function stack that will run every time one of the actions selected takes place.

Restoring a Branch Backup

If after you have merged branches, you would like to restore from a backed up branch, click on the branches option, and check the "Include Backups" checkbox. This will show you all available backups, which you can then click and edit or set live just like any other branches. Setting live the backed up branch will allow you to quickly roll back to before the merge was made.

You can also use a function, to set the X-Branch header followed by the Branch name. For example:

Comparing differences allows you to see the differences between a source branch and a destination branch. Comparing differences gives you full context into what's going to change before you decide to .

Learn more about comparing branches .

merge branches
here
merge
Set Http Header
Branches tutorial before merge capabilities were introduced.
Your root branch is considered v1, and you will start with v1 by default.
Edit or Set Live a Branch.
Compare Branches option.
In this example, we will choose the "dev" branch to compare from.
In this example, we will compare to the "prod" branch.
Comparing branches.
See a snapshot of what's new or what changes were made.
6 changes made to POST /stuff.
The changes made to POST /stuff.
Select Merge Branches.
Choose the Source Branch - the Branch with new changes or updates.
Select the Destination branch, and if you want the destination branch backed up before the merge
Edit what's included in the merge.
Deselect specific changes to remove from the merge.
Select Publish to merge the Branches.
Use the Include Backups option to show backups made during branch merge.