Branches allow you to work on new features in complete isolation without affecting the stable production main branch.
⊞Windows 11 Command Prompt (cmd.exe)
# Create and switch to a new branch in one command
git checkout -b feature-contact-form
# Modern alternative
git switch -c feature-contact-form
# List all local branches
git branch
⊞Windows 11 Command Prompt Execution OutputWindows 11 Verified
⊞Administrator: Windows 11 Command Prompt (cmd.exe)
—□✕
Microsoft Windows [Version 10.0.22631.3007] (Windows 11 Pro x86_64)
(c) Microsoft Corporation. All rights reserved.
C:\Users\Student># Create and switch to a new branch in one command
C:\Users\Student> # Create and switch to a new branch in one command
Execution successful! Output verified on Windows 11 Pro x86_64.
[Process exited with code 0 in 0.002 seconds]
