git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Peter Vereshagin <peter@vereshagin.org>
Cc: git@vger.kernel.org
Subject: Re: checkout from neighbour branch  undeletes a path?
Date: Tue, 13 Nov 2012 08:43:31 -0800	[thread overview]
Message-ID: <7v8va5fo7g.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20121113152341.GC6561@external.screwed.box> (Peter Vereshagin's message of "Tue, 13 Nov 2012 19:23:41 +0400")

Peter Vereshagin <peter@vereshagin.org> writes:

> Am wondering if 'checkout branch path' undeletes the files?

"git checkout branch path" (by the way, "branch" does not have to be
a branch name; any commit object name would do, like "git checkout
HEAD^^ hello.c") is a way to check out named path(s) out of the
named commit.

If the commit "branch" has "path" in it, its contents are checked
out to "path" in your current working tree (and the entry in the
index updated to match it).

If you happen to have removed "path" in your current working tree
before running that command, it might look as if there is some
undelete going on, but that is a wrong way to look at things.  The
version of "path" in the "branch" may or may not be similar to what
you have removed earlier.

  reply	other threads:[~2012-11-13 16:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-13 15:23 checkout from neighbour branch undeletes a path? Peter Vereshagin
2012-11-13 16:43 ` Junio C Hamano [this message]
2012-11-13 18:34   ` Peter Vereshagin
2012-11-13 23:41 ` Junio C Hamano

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=7v8va5fo7g.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peter@vereshagin.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).