How to use @theia/git to switch the specified branch automatically

How can I use git-command to switch the specified branch automatically.

Closing as it is a duplicate of How to use @theia/git.