On Thu, 26 Jun 2014 00:23:39 -0700 (PDT)
chunnu <srirami.ar...@gmail.com> wrote:

> I m new to git repository, with a star team back ground. In my
> project I have something called sub modules. I understand that these
> are a single repository in the git used by 5 different projects. 
> But I m very confused about "updating the submodule references". What
> does this exactly mean? Please note my role is not a developer but
> need to understand this from a developer perspective as well. 
> 
> Can any one please explain?

The history of a project in a Git repository is a graph of interlinked
commits, with each commit representing the snapshot of the
reposiory's state.  Each commit is uniquely identified by its name
(which is a cryptographic hash, SHA-1, calculated over its contents).

Git repositories might also contain branches and tags, which "point to"
commits by recording their names [*].

When a project uses submodules, it must somehow *reference* them.
Obviously, using only a repository's URL for this is not enough in
99% of cases because a typical repository usually contains several
branches and tags and a huge number of commits -- all of them being
"entry points" to some state of the project which history is captured
by the repository, -- so you'd need to narrow down what exactly you're
referencing.  What's more interesting, is that when you reference a
submodule, you'd like to specify *exact* state of the referenced
project, matching a specific state of yours -- this is to have
reproducible builds of software, for instance.

So we've arrived at the conclusion: when you use a submodule, you're
referencing the state of the project in the target repository using
that repository's URL and the name of a specific commit in it; the
latter is called "the reference", and is unique to the target
repository.

These names, references, are recorded with the commits in your local
repository.  From time to time, when the referenced repository is
updated (I mean, updated at the site from where you fetched it, by
whoever pushes to it), and you'd like to make use of these changes in
your project, you'll need to 1) update its submodule in your local
repository by fetching the changes from that repository; 2) update the
reference to that submodule to point to the new, updated, state of the
referenced project maintained in the submodule.

Please also take time and read through [1] -- it possibly contains more
tech speak than I tried to use in my explanation but worth reading
anyway (and it contains way more details on the topic).

[*] tags might point to any object in a repository, not only commits,
    but that's not relevant to our discussion.

1. http://git-scm.com/book/en/Git-Tools-Submodules

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to