What is the difference between git clone and checkout?

后端 未结 5 686
醉话见心
醉话见心 2020-12-22 14:40

What is the difference between git clone and git checkout?

5条回答
  •  感情败类
    2020-12-22 15:33

    One thing to notice is the lack of any "Copyout" within git. That's because you already have a full copy in your local repo - your local repo being a clone of your chosen upstream repo. So you have effectively a personal checkout of everything, without putting some 'lock' on those files in the reference repo.

    Git provides the SHA1 hash values as the mechanism for verifying that the copy you have of a file / directory tree / commit / repo is exactly the same as that used by whoever is able to declare things as "Master" within the hierarchy of trust. This avoids all those 'locks' that cause most SCM systems to choke (with the usual problems of private copies, big merges, and no real control or management of source code ;-) !

提交回复
热议问题