checkout a branch directly and track it if one is specified