logoalt Hacker News

hollowceleryyesterday at 7:30 PM1 replyview on HN

Interesting - I use git checkout constantly, whenever I have a file in another branch or commit that I want to drag into this one wholesale.


Replies

saghmyesterday at 10:18 PM

It's a useful thing to be able to do! It just fundamentally shouldn't be under one command. To its credit, git did add `switch` (with `-c` for creating a new branch and `-d` for specifying detached HEAD), but after two decades I can't imagine they'll ever get rid of checkout entirely because it was so fundamental for so long, and as long as its there, it's a loaded footgun with the safety off.