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

Re: can anybody explain the following to a git noob?

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
May 22, 2009, 12:04 UTC
Message-ID
<alpine.LNX.2.00.0905221259330.27232@reaper.quantumfyre.co.uk>
In-Reply-To
<855e4dcf0905220436h1b6fa632q7804c98bf09b324c@mail.gmail.com>
On Fri, 22 May 2009, Tim Uckun wrote:
Show 21 quoted lines
>>
>> Did test_new contain ignored files?
>
> No.  I put the entire transcript in the first email. I did not tell
> git to ignore anything and there were no .git directories in the test
> folder.
>
>> In this case, when you checkout the
>> branch that does not have test_new, only the tracked files are removed;
>> the ignored (i.e untracked) files remain. Therefore, after the checkout
>> you still have a test_new directory.
>>
>
> As far as I can tell all the files are tracked after I do a commit.
>
> I can understand why it put the original test directory back when I
> changed to the master branch but I don't understand why it's missing a
> subdirectory.  I don't think the test_new directory should be in the
> master branch at all but I guess I can kind of sort of see why git
> might not remove it. What I can't understand at all is why it's
> missing subdirectories.

What's in the subdirectory? Is it empty? If so, that would explain what you are seeing. Git doesn't track directories - so an empty directory is always treated as an untracked file.

Show 5 quoted lines
> I hate to say this but I tried the exact same thing with mercurial in
> the last half hour and it did exactly what I thought it should do. The
> master had the test directory but not the test_new and the branch had
> the test_new directory but not the test. No subdirectories were
> missing out of either one.

I don't know if mercurial tracks directories, if it does, then this would explain why it behaves diffently to git.

-- 
Julian

  ---
Even a cabbage may look at a king.
Previous: Tim UckunNext: Tim Uckun
Message 8 of 16 in “can anybody explain the following to a git noob?”
  1. Tim UckunMay 22, 2009
  2. Avery PennarunMay 22, 2009
  3. Tim UckunMay 22, 2009
  4. Andreas EricssonMay 22, 2009
  5. Tim UckunMay 22, 2009
  6. Johannes SixtMay 22, 2009
  7. Tim UckunMay 22, 2009
  8. Julian PhillipsMay 22, 2009
  9. Tim UckunMay 23, 2009
  10. Andreas EricssonMay 22, 2009
  11. Daniel BarkalowMay 22, 2009
  12. Tim UckunMay 23, 2009
  13. Heiko VoigtMay 25, 2009
  14. Tim UckunMay 25, 2009
  15. Sitaram ChamartyMay 22, 2009
  16. Dan LoewenherzMay 22, 2009

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.