Re: git checkout effect on ls-files --others, how to merge partially?

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

 



On 2009-02-06, Bisani  Alok <alok.bisani@xxxxxxxxxxxxxxxxx> wrote:
>> git checkout branch -- filename

> This is exactly what I was looking for, thank you! I
> wonder why it is the checkout command which does this,
> rather than the pull/merge. What is the reason that we
> cannot pull/merge a specific file from a branch?

Pull is to pull commits between repos, not files between
commits.  (The special case of using "." as the repo is just
that -- a special case; ignore it for now).

Merge is to merge commits within a repo.

Both operate on entire commits, and both *create* a new
commit to record their action (ignore the --no-commit option
in merge for now; that too is a special case IMO, and its
purpose does not detract from the overall sense of what I am
saying anyway)

What you want is an individual file in a commit.  'git show'
is a good way of getting that, as is 'git cat-file blob'
(by the way I prefer 'git cat-file -p').  For blob objects,
all of them seem to do the same thing.

But all of them are geared to putting the file onto stdout,
and you deal with it how you want.  They're all basically
just 'cat', with a couple of extra whiskers perhaps :-)

'git checkout' is meant to 'checkout a branch or paths to
the working tree' -- as it says on the tin, which is what
you want.

Sita

--
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]

  Powered by Linux