git switch main

Category: Git - Core

git switch main

Switch to an existing branch (modern syntax)

Switches to an existing branch using the newer git switch syntax (cleaner than checkout for branch switching).
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.