git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-)

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Dec 31, 2008, 01:43 UTC
Message-ID
<slrnglljie.kdq.sitaramc@sitaramc.homelinux.net>
In-Reply-To
<gje3ok$gnc$4@ger.gmane.org>
On 2008-12-30, Zorba <cr@altmore.co.uk> wrote:
> ** REPRODUCING Possible bug
[long script using "git checkout tag ." removed...]
Conor,

As Stephen said, you're using an extra "." which changes the meaning completely.

In addition, the weird behaviour you see, where AC.txt appears to have sneaked in when you do a "git checkout versionB .", even though versionB does not have that file, is also correct -- read the second para of the DESCRIPTION section in "git help checkout", and note the phrase "update the index ... before updating the working tree".

In other words, the special form of git checkout you used is updating not only the working tree but also the index. So when you checked out versionA in this manner, AC.txt got into the index (as well as the working tree).

Your subsequent "rm *.*" only deeltes those files from the working tree; they're still in the index. To see this, run "git ls-files -s" just after each "rm *.*".

You can also get the results you *want* to get by running a "git reset --hard" instead of "rm *.*", since your top commit in the current branch (which is what this would default to) has no files in it anyway.

Happy New Year from India to Northern Ireland and everyone else in the world :-)

Previous: Boyd Stephen Smith Jr.Next: Daniel Barkalow
Message 20 of 21 in “for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-)”
  1. ZorbaDec 27, 2008
  2. ZorbaDec 28, 2008
  3. Jeff WhitesideDec 29, 2008
  4. ZorbaDec 30, 2008
  5. Jeff WhitesideDec 30, 2008
  6. ZorbaDec 30, 2008
  7. Sitaram ChamartyDec 30, 2008
  8. ZorbaDec 30, 2008
  9. ZorbaDec 30, 2008
  10. ZorbaDec 30, 2008
  11. Jeff WhitesideDec 30, 2008
  12. ZorbaDec 30, 2008
  13. Jeff WhitesideDec 30, 2008
  14. Daniel BarkalowDec 30, 2008
  15. ZorbaDec 31, 2008
  16. ZorbaDec 30, 2008
  17. Boyd Stephen Smith Jr.Dec 30, 2008
  18. Boyd Stephen Smith Jr.Dec 30, 2008
  19. Boyd Stephen Smith Jr.Dec 30, 2008
  20. Sitaram ChamartyDec 31, 2008
  21. Daniel BarkalowDec 30, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.