git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* checkout extra files
@ 2012-09-03 13:42 Angelo Borsotti
  2012-09-03 13:55 ` Carlos Martín Nieto
  2012-09-03 13:59 ` Nguyen Thai Ngoc Duy
  0 siblings, 2 replies; 36+ messages in thread
From: Angelo Borsotti @ 2012-09-03 13:42 UTC (permalink / raw)
  To: git

Hello,

the man page of git checkout states:

git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>...

It updates the named paths in the working tree from the index file or
from a named <tree-ish> ...

This means that for each file denoted by pathspec, git tries to
restore it from the tree-ish.
However, it seems that git does more than this: it restores also files
that are not denoted
by pathspec.
This sequence of commands shows it:

$ mkdir gittest
$ cd gittest
$ git init
Initialized empty Git repository in d:/gittest/.git/
$ touch f1
$ git add f1
$ git commit commit -m "first commit"
[master (root-commit) 94d882a] first commit
 0 files changed
 create mode 100644 f1
$ rm f1
$ git checkout 94d8 -- *
$ ls
f1

Note that the work directory is empty when the checkout is done, and
that the checkout restores f1
in it, a file that is not denoted by the * pathspec.
I guess that this is the intended behaviour, and that the man page
should be updated to tell exactly
what files git restores.

-Angelo Borsotti

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2012-09-10 20:34 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-03 13:42 checkout extra files Angelo Borsotti
2012-09-03 13:55 ` Carlos Martín Nieto
     [not found]   ` <CAB9Jk9AkFW-fAqOZuhCMgMBdEZwDpe5ZG9Dkse=Wz_x9LvJEPw@mail.gmail.com>
2012-09-03 14:47     ` Carlos Martín Nieto
     [not found]       ` <CAB9Jk9BjO+HdxhaGxEyaDoXgGisi0QpuVvsx3dZUnJV1VoKN1g@mail.gmail.com>
2012-09-04  1:57         ` Carlos Martín Nieto
2012-09-03 13:59 ` Nguyen Thai Ngoc Duy
2012-09-03 19:36   ` Junio C Hamano
2012-09-04  1:49     ` Nguyen Thai Ngoc Duy
2012-09-04  2:55       ` Junio C Hamano
2012-09-04  7:15         ` Angelo Borsotti
2012-09-04  8:53           ` Junio C Hamano
2012-09-04 14:30           ` Junio C Hamano
2012-09-04 16:15             ` Junio C Hamano
2012-09-07 20:49               ` Junio C Hamano
     [not found]                 ` <CAB9Jk9BtZzgi32kxVTbGC7eAjFG41bdae=MaK==sKq=9ohf8_w@mail.gmail.com>
2012-09-08 18:54                   ` Junio C Hamano
2012-09-10  0:24                     ` Junio C Hamano
2012-09-08 20:40                 ` Philip Oakley
2012-09-09  3:31                   ` Junio C Hamano
2012-09-09 13:48                     ` Matthieu Moy
2012-09-09 18:23                       ` Junio C Hamano
2012-09-09 23:25                         ` Philip Oakley
2012-09-10 16:19                 ` Jeff King
2012-09-10 17:09                   ` Junio C Hamano
2012-09-10 17:19                     ` Jeff King
2012-09-10 19:35                       ` Junio C Hamano
2012-09-10 19:53                         ` [PATCH 1/2] gitcli: formatting fix Junio C Hamano
2012-09-10 19:54                           ` [PATCH 2/2] gitcli: contrast wildcard given to shell and to git Junio C Hamano
2012-09-10 20:11                         ` checkout extra files Jeff King
2012-09-10 20:34                           ` Junio C Hamano
2012-09-04 10:14         ` Nguyen Thai Ngoc Duy
     [not found]           ` <CAB9Jk9CNYr6LfWvyVqXvHjh7dzhUAuzkufqO9YMeOXg08D2cJw@mail.gmail.com>
     [not found]             ` <CACsJy8AUYigHVKjzE-0NT0hnOrQWdufN+COmkk=2Q8L1Rimytw@mail.gmail.com>
2012-09-04 13:24               ` Angelo Borsotti
2012-09-04 16:49                 ` Junio C Hamano
2012-09-04 19:29                   ` Angelo Borsotti
2012-09-04 20:44                     ` Junio C Hamano
2012-09-04 22:53                       ` Philip Oakley
2012-09-04 23:31                         ` Junio C Hamano
2012-09-04 15:31           ` Junio C Hamano

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).