Re: checkout on an empty directory fails
- From
- Holger Hellmuth <hellmuth@ira.uka.de>
- Date
- Jan 5, 2012, 13:59 UTC
- Message-ID
- <4F05ACD6.6040603@ira.uka.de>
- In-Reply-To
- <4F0599E0.7090902@gmx.de>
On 05.01.2012 13:38, René Doß wrote:
> git status says not special informations.
versus
Show 14 quoted lines
> red@linux-nrd1:~/iso/a> git status > # On branch master > # Changed but not updated: > # (use "git add/rm <file>..." to update what will be committed) > # (use "git checkout -- <file>..." to discard changes in working directory) > # > # deleted: SP601_RevC_annotated_master_ucf_8-28-09.ucf > # deleted: rtl/ether_speed.vhd > # deleted: rtl/ether_top.vhd > # deleted: rtl/ether_tx.vhd > # deleted: rtl/takt.vhd > # deleted: sim/makefile > # deleted: sim/tb_ether_top.vhd > #
This *is* special information: It tells you that master has those 7 files but your working directory has none of them (i.e. it is as if you had deleted them from your working directory).
"git checkout <branch>" switches between branches, *but* leaves changes you made (files you edited, added or deleted) intact! This is so you can switch branches before commiting if you suddenly realize you are in the wrong branch.
"git checkout -- <paths...>" or in your case "git checkout -- ." is different, it really overwrites the files in your working dir with the versions stored somewhere else, by default from the index.
> What means the point in checkout?
"." is simply your current directory