gpt4 book ai didi

git - 引入 git switch 后,git checkout 还能做什么?

转载 作者:行者123 更新时间:2023-12-04 07:57:23 25 4
gpt4 key购买 nike

众所周知,git checkout是一个非常重载的命令。而且我确实理解某些命令被引入分发,例如至 git switch .
在我使用以下命令之前:

$ git checkout <existing-branch>
$ git checkout <hash>
$ git checkout -b <new-branch-name>
所以我想知道 git switch介绍完了, git-checkout的左目的是什么? ?这是一个已弃用的命令吗?

最佳答案

至少保留它是为了向后兼容。想想数百万仍在使用的脚本 git checkout ——我们是不是应该赶紧重写所有这些?当然没有。
实际上,它甚至没有被弃用。 the docs 中没有关于弃用的内容.另一方面,文档 git restore git switch 说“这个命令是实验性的。行为可能会改变。”

关于git - 引入 git switch 后,git checkout 还能做什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66629436/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com