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

Re: untracked file deleted from the master branch, when checked out to it from a local branch

From
SOSergei Organov <osv@javad.com>
Date
May 21, 2014, 10:21 UTC
Message-ID
<8761kz5t57.fsf@osv.gnss.ru>
In-Reply-To
<2654529.8c5AhJCJsq@linux-wzza.site>
Arup Rakshit <aruprakshit@rocketmail.com> writes:
[...]
> Now you can see, that I have created, a new file called *file.txt*, in the 
> *master branch*.

And here is your basic misunderstanding. You've created file.txt indeed, but not in the *master branch* (or any branch). You've created it in the working directory. Only after you add/commit it, will it be "created" in the branch that is checked out at this time. Until then, git won't touch the file when you switch between branches.

-- Sergey.
Previous: Marius Storm-OlsenNext: Marius Storm-Olsen
Message 9 of 10 in “untracked file deleted from the master branch, when checked out to it from a local branch”
  1. Arup RakshitMay 20, 2014
  2. Marius Storm-OlsenMay 20, 2014
  3. Arup RakshitMay 20, 2014
  4. Marius Storm-OlsenMay 20, 2014
  5. Arup RakshitMay 20, 2014
  6. Junio C HamanoMay 20, 2014
  7. Arup RakshitMay 20, 2014
  8. Marius Storm-OlsenMay 20, 2014
  9. Sergei OrganovMay 21, 2014
  10. Marius Storm-OlsenMay 20, 2014

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.