github desktop how to rebase current branch off master code example

Example 1: how to track a branch on github

$ git checkout --track origin/serverfix
Branch serverfix set up to track remote branch serverfix from origin.
Switched to a new branch 'serverfix'

Example 2: git clean all submodules on branch switch

# Be careful it will delete all untracked files, reset all stagated files
# and will remove all submodule folders
git reset --hard
git checkout gh-pages
git clean -xffd
# Optional restoration of submodules content
git submodule update --init --recursive