Update the name of a deployment branch
Environments on WordPress VIP are set up to track a specific branch of a wpcomvip GitHub repository. For example, new production environments are set up to track a branch named production
. Pushing any changes to this branch (via a push, merge, or rebase) triggers an automatic deployment to the production environment.
The deployment branch for any environment can be renamed or changed by completing each of the following required steps:
- Make sure the new branch exists.
- If renaming, you can just create a new branch from the current deployment branch with the desired name. This can be done using Git CLI or manually creating the new branch in the repository.
- Create a request with VIP Support to update the branch that tracks to production. Include details about the environment and the name of the new branch that should replace the existing deployment branch.
- Wait for VIP Support to confirm that the branch and related configuration settings are complete.
- If the previous deployment branch was the repository’s default branch, update it to the new one by following these instructions.
If unused, the previous deployment branch can now be removed by completing the following steps:
- Clone the application’s wpcomvip GitHub repository to a local machine:
git clone git@github.com:wpcomvip/REPO_NAME.git
- Enter the folder on the local machine:
cd REPO_NAME
- Delete the old branch:
git push origin --delete old-branch-name
git branch -d old-branch-name
Last updated: April 03, 2023