Your command says "please checkout every file I have from the index", so 
[almost] obviously it won't warn you, as you explicitly requested all files be 
checked out  - it's more obvious if you ask "git checkout myfile" (obvious 
overwrite), and then think about what '.' means as a replacement for myfile.

You could suggest a patch for the documentation if you are passionate about it, 
but it would need to be carefully worded. Be clear what the issue is. Is it the 
use of ".", or that myfile is overwritten when modified.  

Make sure you inform the person who suggeste that form of the command of the 
error of their ways. Maybe they should have warned you ;-)

Philip
  ----- Original Message ----- 
  From: miraz 
  To: git-users@googlegroups.com 
  Sent: Thursday, July 12, 2012 1:35 PM
  Subject: [git-users] "git checkout ." overwrites all my changes


  Hi,
  entering the command
  git checkout .
  in the root directory of my git repository overwrites all my modified files 
without any warning.
  Why is there such a dangerous command?
  Mirek.



  -- 
  You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
  To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/pcel1xvHYdsJ.
  To post to this group, send email to git-users@googlegroups.com.
  To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

  No virus found in this message.
  Checked by AVG - www.avg.com
  Version: 2012.0.2195 / Virus Database: 2437/5126 - Release Date: 07/11/12

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to