---
title: Why are my branch specific variables and domains not linked to my CLI deployments?
description: How to link CLI deployments to the correct branch for use with custom environments and branch specific domains and environment variables
url: /kb/guide/branch-variables-and-domains-not-linked-to-cli-deployments
canonical_url: "https://vercel.com/kb/guide/branch-variables-and-domains-not-linked-to-cli-deployments"
published: 2025-11-03
last_updated: 2026-07-16
authors: Tilly Gee
related:
  - /docs/deployments/custom-environments
  - /docs/cli/deploy
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---
<!-- docsgraph:related -->
## Related pages

> **For AI agents:** Follow these links to understand how this page connects to the rest of the Vercel ecosystem. For the full cross-link map (inbound, outbound, prerequisites, and semantic neighbors), see the .graph.md link below.

- [Git Integrations](https://vercel.com/docs/git?from=related) — Vercel allows for automatic deployments on every branch push and merges onto the production branch of your GitHub, GitLa
- [Project Linking](https://vercel.com/docs/cli/project-linking?from=related) — Learn how to link existing Vercel Projects with Vercel CLI.
- [Deploy from CLI](https://vercel.com/docs/projects/deploy-from-cli?from=related) — Set up and deploy a Vercel project using the CLI, from linking to production.
- [Assigning a Domain to a Git Branch](https://vercel.com/docs/domains/working-with-domains/assign-domain-to-a-git-branch?from=related) — Learn how to assign a domain to a different Git branch with this guide.
- [Deploying from CLI](https://vercel.com/docs/cli/deploying-from-cli?from=related) — Learn how to deploy your Vercel Projects from Vercel CLI using the vercel or vercel deploy commands.
- [How do I set up a staging environment on Vercel?](https://vercel.com/kb/guide/set-up-a-staging-environment-on-vercel?from=related) — Information on how to set up a staging environment on Vercel.
- [How can I use GitLab Pipelines with Vercel?](https://vercel.com/kb/guide/how-can-i-use-gitlab-pipelines-with-vercel?from=related) — Learn how to use GitLab Pipelines to deploy to Vercel including support for self-managed GitLab.
- [Why do my Vercel deployments have multiple domains?](https://vercel.com/kb/guide/why-do-my-vercel-deployments-have-multiple-domains?from=related) — Learn about why Vercel auto generates URLs for your deployments.
- [Can you deploy based on tags/releases on Vercel?](https://vercel.com/kb/guide/can-you-deploy-based-on-tags-releases-on-vercel?from=related) — Learn how to deploy based on tags/releases on Vercel.

Full cross-link map for this page: [/kb/guide/branch-variables-and-domains-not-linked-to-cli-deployments.graph.md](/kb/guide/branch-variables-and-domains-not-linked-to-cli-deployments.graph.md)
<!-- /docsgraph:related -->


If you’re using the Vercel CLI to create deployments, either from a local environment or within your CI/CD pipeline, you may see that branch specific [custom environments](https://vercel.com/docs/deployments/custom-environments#custom-environments), including variables and domains, are not being correctly linked.

The most common reason for this is because the git meta information is missing and so the deployment on Vercel is not linked to a specific branch and instead defaults to HEAD.

## Link CLI deployments to a git branch

To resolve this, you can make sure the correct meta information is passed through with the `vercel deploy` command by making use of the [`--meta`](https://vercel.com/docs/cli/deploy#meta) or `-m` option.

This is available for GitHub, GitLab and Bitbucket with the following git related parameters:

```text
“meta”: 
   { 
      “githubCommitAuthorName”: “Author Name”, 
      “githubCommitMessage”: “Commit Message”, 
      “githubCommitOrg”: “your-github-organization”, 
      “githubCommitRef”: “feature/branch-name”, 
      “githubCommitRepo”: “repository-name”, 
      “githubCommitSha”: “3A614DC”, 
      “githubDeployment”: “1”, 
      “githubOrg”: “your-github-organization”, 
      “githubRepo”: “repository-name”, 
      “githubCommitAuthorLogin”: “Username” 
   }
```

The above example uses GitHub, but this can be replaced with either GitLab or Bitbucket depending on which provider you are using.

When using the `--meta` option, please note that you must always include one of `githubDeployment=“1"`, `gitlabDeployment="1"` or `bitbucketDeployment="1"` to confirm which of those three git providers you are using. This is needed as well as the parameter you are passing so the information can be correctly added to the deployment on the Vercel platform.

An example of using this to add the branch information is shown below:

```text
vercel deploy -m githubDeployment=“1" -m githubCommitRef=“feature/branch-name”
```