git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "armencho\@gmail.com" <armencho@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: .git and retrieving full source tree for own project(s)
Date: Fri, 04 Sep 2009 13:04:31 -0700	[thread overview]
Message-ID: <7viqfyfpdc.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <981b72360909041252i29551a5chb8b3a2a5c6444ee3@mail.gmail.com> (armencho@gmail.com's message of "Fri\, 4 Sep 2009 21\:52\:07 +0200")

"armencho@gmail.com" <armencho@gmail.com> writes:

> What I am wondering about is, what is gits identity for a repository?
> I don't share or publish the source directory anywhere, and just for
> testing I removed everything but the ".git" directory and tried "git
> checkout" and "git checkout master".

"git checkout" is a short-hand for "git checkout HEAD" which is to request
"switch to the branch denoted by HEAD, i.e. the current branch, while
keeping my local changes to the work tree and the index".

"git checkout master" is a request to "switch to the master branch, while
keeping my local changes to the work tree and the index".

In this case, your "delete everything" is your local change, and git did
its best to preserve it while switching branches.

If you want to "copy this and that files and directories out of the
commit at the tip of the current branch and deposit them in my work tree
and index", you would say

    $ git checkout HEAD this that

so a request for checking everything out would be a natural extension of
the above that would be:

    $ git checkout HEAD .

If you want to "copy this and that files and directories out of the index
and deposit them in my work tree", you would say

    $ git checkout this that

  reply	other threads:[~2009-09-04 20:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-04 19:52 .git and retrieving full source tree for own project(s) armencho
2009-09-04 20:04 ` Junio C Hamano [this message]
2009-09-04 20:18   ` armencho

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

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

  git send-email \
    --in-reply-to=7viqfyfpdc.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=armencho@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.
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 NNTP newsgroup(s).