git: prefer switch over checkout

· Thiago Perrotta · March 20, 2025, 1:11 p.m.
Summary
This blog post discusses the differences between the Git commands 'git switch' and 'git checkout', emphasizing the ambiguity of 'git checkout' and how 'git switch' simplifies branch switching. The author shares personal experiences to illustrate the confusion caused by a directory named 'main' interfering with the 'git checkout' command, concluding with an updated alias that incorporates 'git switch' for clarity and efficiency.
AUTHOR
Sponsored
Zulip logo Zulip
Organized team chat for people who take work seriously. Topic-based threading keeps conversations focused.
Try Zulip
Become a sponsor →