git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sankar P <sankar.curiosity@gmail.com>
To: git@vger.kernel.org
Subject: Git clone question
Date: Tue, 7 Apr 2020 23:52:40 +0530	[thread overview]
Message-ID: <CAMSEaH5eZdNooNHQJAto_0dCZSFtiji8ZYvft+oZQXfzDHSyEg@mail.gmail.com> (raw)
In-Reply-To: <CAMSEaH6+fQuDjhY-5THoYpEjjrHU4Sofnmr-nASHaTZbHvQw1w@mail.gmail.com>

Hi

I am trying to understand about git clone.

From the few git videos that I have watched and using git, I
understand that git stores the difference between each version, as an
object, with the sha of the diff as the way to address the object.

However, what is not clear to me is, how does `git clone` then work ?
If a repository has a thousand commits, do we download all the
thousand objects to the client system and then apply them one on top
of the other ? I am sure that must not be the case because the `git
clone` operation completes so fast, and I doubt if my disks are that
fast.

However, when I do a `git clone` I could see the history until the first commit.

I can also partially ignore the history and clone only the last N
commits history too. So my question is, how does `git clone` work
under the hood and how is it so fast ? Does the git server save the
expanded git tree (with all the git patches applied) and we just
transfer them when we do the `git clone` ?

Are there any good talks / papers / books on the internals of the
working of git ?

Thanks.


-- 
Sankar P
http://psankar.blogspot.com

       reply	other threads:[~2020-04-07 18:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMSEaH6+fQuDjhY-5THoYpEjjrHU4Sofnmr-nASHaTZbHvQw1w@mail.gmail.com>
2020-04-07 18:22 ` Sankar P [this message]
2020-04-07 20:01   ` Git clone question Bryan Turner
2020-04-08  2:27     ` Sankar P

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMSEaH5eZdNooNHQJAto_0dCZSFtiji8ZYvft+oZQXfzDHSyEg@mail.gmail.com \
    --to=sankar.curiosity@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).