Re: (beginner) git rm

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Zabre <427@...>
Cc: <git@...>
Date: Wednesday, January 28, 2009 - 4:17 pm

On 2009.01.28 10:23:12 -0800, Zabre wrote:

The "git checkout -- d.txt" is also a valid command, but that restores
the file from the index.

git checkout -- paths
	==> Copy "paths" from the index to the working tree

git checkout <tree-ish> -- paths
	==> Copy "paths" from the tree-ish to the index and working tree

So, for "rm d.txt", a plain "git checkout -- d.txt" would also do the
trick, as d.txt is still in the index. But your "git rm d.txt" also
removed the file from the index, and thus that checkout does nothing.
But "git checkout HEAD -- d.txt" works, as it gets the file from HEAD
and puts it into the index and working tree.

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)