I have a repository on github with a main branch (master) and a branch for some experimental work. I made some commits and pushed to the experimental branch and everything
With Git 2.23 (August 2019), you would use the git switch command
If you have a remote branch of the same name, it will be automatically tracked:
$ git switch new-topic Branch 'new-topic' set up to track remote branch 'new-topic' from 'origin' Switched to a new branch 'new-topic'