How to Change the Branch for an Existing Porter App
Last updated: February 6, 2026
While Porter doesn't provide a direct option to change the branch of an existing project through the user interface, you can still achieve this by modifying your GitHub workflow file. This change will take effect in the background, even though it won't be reflected in the Porter UI.
Steps to Change the Branch:
Navigate to your project's GitHub repository.
Locate the Porter workflow file (typically found in the
.github/workflowsdirectory).Open the workflow file for editing.
Find the section that specifies the branch name.
Update the branch name to your desired branch (e.g., from
maintoproduction).Commit and push the changes to your repository.
After making these changes, Porter will use the new branch for deployments and other operations, even though the UI may still display the original branch name.
The change in branch will be effective for Porter's operations, but it won't be visually reflected in the Porter user interface. This UI discrepancy is only cosmetic and will not affect your app's functionality. If you need the UI to display the correct branch name, you can create a new application as a workaround, though this is not necessary for proper operation.
Example Workflow File Change:
Here's an example of how you might update your workflow file:
# Before
on:
push:
branches: [main]
# After
on:
push:
branches: [production]
By making this change, you're instructing Porter to watch and deploy from the 'production' branch instead of 'main'.