On Fri, 14 Jun 2013 05:08:11 -0700 (PDT)
Deanna Delapasse <ddelapa...@gmail.com> wrote:

> I need to checkout code from a repo and somehow identify it
> (timestamp, hash, …) such that at some later time I can extract the
> SAME versions of all the code.
> 
> I’m provisioning cloud instances, so each time would be a fresh “get
> clone” into an empty folder.  After I create the “master” (ie
> provision the FIRST instance) I need to record some way to identify
> it in case I have to recreate the master.I prefer NOT to alter the
> original repo (ie tag it), but prefer the ‘work’ of identifying the
> sources to be done on the client side.

I'm not sure I exactly understand what do you want.

If you do `git clone` on a client, then a mere call to

git rev-parse HEAD

would show you the SHA-1 name of the commit which is currently checked
out to the work tree of that client's clone.

Is this enough for your case?

If you want to identify a commit in a Git repository having just a tree
of (unmodified) sources checked out some time earlier, this task is
more complicated: you could commit this whole tree and get the SHA-1
hash name of the root tree object.  Getting the name of a commit object
which references the same tree object in a master repository is,
unfortunately, an O(N) task: you'll have to traverse all the commits
and check the SHA-1 names of the root tree objects they reference.

-- 
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/groups/opt_out.


Reply via email to