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
Junio C Hamano <gitster@pobox.com>
Date
May 20, 2014, 18:24 UTC
Message-ID
<xmqqk39gz4tw.fsf@gitster.dls.corp.google.com>
In-Reply-To
<2726779.MFtIaLB4b4@linux-wzza.site>
Arup Rakshit <aruprakshit@rocketmail.com> writes:
Show 12 quoted lines
> On Tuesday, May 20, 2014 12:06:49 PM you wrote:
>
>> 
>> It never "came to the new branch", as it was never version controlled,
>> it was an untracked file left behind when you switched branches.
>> 
>> Once you added it to the new branch, change_class, it became a version
>> controlled file, 
>
> This is still  didn't get it. If an untracked file didn't come in the new 
> branch, how would I able to add it to stage ? I am not getting this part. You 
> are right, but I am not able to understand this one, my bad! :(

Untracked files and modifications to files in your working directory do not belong to your current branch. This is to allow you, after starting to work on one branch then realizing that the changes and additions you are making do not belong there, to switch to a more appropriate branch at that point without losing your work so far, taking these changes and additions with you to the branch you want to commit your changes to.

Previous: Arup RakshitNext: Arup Rakshit
Message 6 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.