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

Re: [BUG?] After 'git checkout', files deleted upstream are left in the working directory as untracked

From
Johannes Sixt <j6t@kdbg.org>
Date
Oct 11, 2020, 06:58 UTC
Message-ID
<8f88733f-4f20-6215-00a8-de3024b8c4cb@kdbg.org>
In-Reply-To
<3D3C5F5D-830E-4EC7-A527-DC595D983BB2@gmail.com>
Am 10.10.20 um 18:43 schrieb Philippe Blain:
Show 18 quoted lines
> The thing is, I can't reproduce it on a fresh clone. If I could, this would be a reproducer:
> 
> ```
> $ git clone git@github.com:phil-blain/git.git && cd git
> $ git checkout stale-branch
> $ git checkout other-branch
> $ git status # the following is what is shown in my old clone
> On branch other-branch
> Untracked files:
>   (use "git add <file>..." to include in what will be committed)
> 
> 	git-legacy-stash
> 	git-remote-testsvn
> 	t/helper/test-line-buffer
> 	t/helper/test-svn-fe
> 
> nothing added to commit but untracked files present (use "git add" to track)
> ```

This is normal. These 4 files are build products and were never committed files. They had been mentioned in .gitignore in the past, but are not anymore.

Apparently, your old repository had these build products still lying around. If you insert `make` in your instructions above after `git checkout stale-branch`, you should be able to observe the same un-cleanlyness in a new clone.

-- Hannes
Previous: Philippe BlainNext: Philippe Blain
Message 2 of 4 in “[BUG?] After 'git checkout', files deleted upstream are left in the working directory as untracked”
  1. Philippe BlainOct 10, 2020
  2. Johannes SixtOct 11, 2020
  3. Philippe BlainOct 11, 2020
  4. Johannes SchindelinOct 12, 2020

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.