Issue
I want to change the default branch for my Appsmith apps.
Resolution
Let's address the two scenarios where users might want to change their default branch:
Scenario 1 ✅
Multiple apps are connected to a single repository, and the user wants to have different default branches for different apps. This is supported in Appsmith Enterprise Edition, you can follow the below steps to achieve this -
- Open the desired git connected app in Appsmith.
- Click on the ⚙️ option in the bottom bar beside Git action buttons.
- Find the "Default Branch" section and click on the dropdown menu.
- Select the preferred branch that you want to set as the default.
- After selecting the new default branch, click on "Update" button to apply the changes.
- The default branch for your app in Appsmith will now be updated to the branch you selected.
Scenario 2 ✅
A single app is connected to a repository, and the user wants to change the default branch for that app. The following are the steps to achieve this -
Step 1 -
Go to git-sync, and check if the new default branch exists in the remote repository: `origin/temp`
Step 2 -
Go to the remote repository and go to the `settings > general settings` section
Step 3 -
Find the Default Branch section and click on the `switch to different branch` button to select and update the new default branch. Lastly, click on `I understand ...` for it to take an affect.
Step 4 -
Go back to your Appsmith app and click on `sync branches` to synch the default branch change from the repository.
Tada 🎉
Now when you enter the edit mode, by default the `temp` branch will be selected.