What is the difference between git clone and checkout?

Praveen Sripati picture Praveen Sripati · Sep 4, 2011 · Viewed 315k times · Source

What is the difference between git clone and git checkout?

Answer

August Lilleaas picture August Lilleaas · Sep 4, 2011

The man page for checkout: http://git-scm.com/docs/git-checkout

The man page for clone: http://git-scm.com/docs/git-clone

To sum it up, clone is for fetching repositories you don't have, checkout is for switching between branches in a repository you already have.

Note: for those who have a SVN/CVS background and new to Git, the equivalent of git clone in SVN/CVS is checkout. The same wording of different terms is often confusing.