Re: Instructions concerning detached head lead to lost local changes

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

 



On Thu, Feb 01, 2007 at 09:49:27PM -0500, Nicolas Pitre wrote:
> It might be some work to get to a given position with a detached head 
> and this very position might be valuable information, but if you then do 
> "checkout HEAD^" you will still be detached but your previous position 
> is lost just like it would be if you moved to master.  Yet you're not 
> prevented from going to HEAD^ but you are prevented from going to 
> master.

Exactly.  With Junio's reasoning, then why aren't we forcing -f in this sequence:

git checkout HEAD^
git checkout HEAD^^
git checkout HEAD^^^
git checkout -f master

The first three are just as likely to "lose" information as the last.
Personally, I don't think any of this is "losing" information, any
more than I "lose" information in the following sequence of commands:

cd /usr/src/linux/drivers/net
cd /usr/src/linux/drivers/char
cd /usr/src/linux/fs/ext3
cd /home/tytso

The current working directory is just like the detached HEAD.  If I'm
moving it around, there is no loss of data.  cd != rm.

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