checkout extra files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]