forest branch command is at the center of what your Forest Admin development workflow should look like. As explained on this page, it allows you to manage your UI, a bit like you would use git's branches for your code.
$ forest branch --helpCreate a new branch or list your existing branches.USAGE$ forest branch [BRANCH_NAME]ARGUMENTSBRANCH_NAME The name of the branch to create.OPTIONS-d, --delete Delete the branch.--force When deleting a branch, skip confirmation.--help Display usage information.--projectId=projectId The id of the project to create a branch in.
Here are a few extra details on how it works.
forest branch command has 3 uses, depending on how you use it:
To list your existing branches, simply omit any argument to the command:
$ forest branchfeature/new-button < current branchfix-missing-labelfeature/remove-tooltip
To create a new branch, append the name of the branch you wish to create after
forest branch, like so:
$ forest branch feature/new-ops-feature✅ Switched to new branch: feature/new-ops-feature
Note that your project must be deployed remotely before you can start using branches:
$ forest branch add-refund-action❌ You cannot create a branch until this project has either a remote or a production environment.
Any branch reflects
LayoutChange(s) (i.e. changes in your UI) that you've made on that branch: to make this possible, a branch needs an origin, which is the state of the layout you started from and made those
LayoutChange(s) on. This is why you need to have a production environment (ideally) or simply a remote environment: that environment will serve as origin to your branches.
To delete a branch, simply add the -d option and a branch name to the
forest branch command:
$ forest branch -d hotfix/fix-dropdown-issue[? Delete branch "hotfix/fix-dropdown-issue"? Y✅ Branch hotfix/fix-dropdown-issue successfully deleted.