Git fetch vs checkout8/2/2023 ![]() I have not found a full comparison of the commands anywhere. Note that as of December 2021, the new commands are still listed as experimental ( switch, restore): Old "git checkout" command is still here and will be until all (or mostįrom this, it's clear that the new commands were introduced to reduce confusion by having two focused commands, rather than one multi-purpose command. To remedy that, theĬommand will be split into two new ones: switch and restore. Users (and it even bites old timers sometimes). "git checkout" doing too many things is a source of confusion for many The commit that added the switch command explains the rationale for the new commands in its commit message: Git-checkout - Switch branches or restore working tree files This dual purpose of checkout can be seen in its summary description in the documentation: In other words, checkout does two different things, and this release split each of those different things into its own focused command. ![]() "checking out paths out of the index and/or a tree-ish to work on advancing the current history"."checking out a branch to work on advancing its history". ![]() Detailed explanationĪs you noted in the 2.23.0 release notes section you quoted, the switch and restore commands were introduced to split the checkout command into two separate pieces: In particular, unlike checkout it cannot restore working tree files - that is instead done using the restore command that was introduced alongside switch. The switch command indeed does the same thing as checkout, but only for those usages that switch branches.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |