Re: (beginner) git rm

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

 




Björn Steinbrink 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.
> 

This is enlightening, thank you very much!
(I knew I would love git more and more)

Oh just one (probably stupid) thing : <tree-ish> does represent a directory
being the root of a tree of folders (which has been added to the index),
does it?
This is the way I understand it at the moment. It must be a convention I
don't know just yet. (I need to investigate on this)
-- 
View this message in context: http://n2.nabble.com/%28beginner%29-git-rm-tp2231416p2234796.html
Sent from the git mailing list archive at Nabble.com.

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