Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No thanks, I will keep using checkout.


Me too. The checkout command makes sense and seems consistent to me: check out branches or files. Why do I need two other different commands for this?


The two are added with some extra protections. Something that cannot be done with git-checkout without breaking scripts.

I believe git-checkout could silently overwrite data in one case (can't remembe the details). And git-swith will stop you from moving the branch when you're in a middle of a rebase or other multi-command operations. It also tries to avoid entering detached HEAD mode by default.

It's definitely geared towards newcomers. But even I'm glad it catches me from doing stupid things from time to time.


Exactly. The way I see it is that “checkout” has two arguments:

- the commit you want to checkout, which defaults to HEAD

- the files you want to checkout, which defaults to everything

Simple as.


The problem is that this breaks down when you specify both arguments. Doing `git checkout branch file` checks out file from branch to the working tree, but doesn't change HEAD.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: