Re: (beginner) git rm

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: Zabre <427@...>, <git@...>
Date: Wednesday, January 28, 2009 - 6:13 pm

[Zabre, please keep the Cc: list when replying]

On 2009.01.28 13:29:36 -0800, Junio C Hamano wrote:

With "checkout", I'm still a bit unsure about which term to use, because
of the behaviour you get with, for example, "git checkout HEAD --
directory". It always just adds or replaces files, but never removes
them. So it's not really like taking the old directory out of the repo
and using that instead. For example:

git rm dir/old_file
echo 123 > dir/new_file
git add dir/new_file
git checkout HEAD -- dir

That won't remove dir/new_file from the index (and of course it won't
drop it from the working tree). That's the one thing where "git checkout
HEAD -- dir" differs from "git reset HEAD -- dir && git checkout --
dir". IIRC we've talked about that on #git a few months ago, but I don't
recall what conclusions we came up with.

It would probably be better to say that checkout only works with the
blobs (because the index doesn't have entries for trees, right?) that
exist in the given tree-ish. And thus it doesn't remove entries from the
index. But that feels a bit convoluted. :-/

Björn
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
(beginner) git rm, Zabre, (Wed Jan 28, 6:11 am)
Re: (beginner) git rm, Peter Krefting, (Wed Jan 28, 6:36 am)
Re: (beginner) git rm, Zabre, (Wed Jan 28, 7:05 am)
Re: (beginner) git rm, Tomas Carnecky, (Wed Jan 28, 7:37 am)
Re: (beginner) git rm, Zabre, (Wed Jan 28, 8:00 am)
Re: (beginner) git rm, Tomas Carnecky, (Wed Jan 28, 8:19 am)
Re: (beginner) git rm, Zabre, (Wed Jan 28, 2:23 pm)
Re: (beginner) git rm, Björn, (Wed Jan 28, 4:17 pm)
Re: (beginner) git rm, Zabre, (Wed Jan 28, 4:42 pm)
Re: (beginner) git rm, Junio C Hamano, (Wed Jan 28, 5:29 pm)
Re: (beginner) git rm, Björn, (Wed Jan 28, 6:13 pm)
Re: (beginner) git rm, Junio C Hamano, (Wed Jan 28, 6:33 pm)
Re: (beginner) git rm, Zabre, (Wed Jan 28, 5:05 pm)
Re: (beginner) git rm, Theodore Tso, (Wed Jan 28, 9:03 am)
Re: (beginner) git rm, Zabre, (Wed Jan 28, 2:25 pm)