git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marius Storm-Olsen <marius@storm-olsen.com>
To: Arup Rakshit <aruprakshit@rocketmail.com>, git@vger.kernel.org
Subject: Re: untracked file deleted from the master branch, when checked out to it from a local branch
Date: Tue, 20 May 2014 12:06:49 -0500	[thread overview]
Message-ID: <537B8BA9.7060207@storm-olsen.com> (raw)
In-Reply-To: <1949847.AaDQEtxZHd@linux-wzza.site>

On 5/20/2014 11:03 AM, Arup Rakshit wrote:
> On Tuesday, May 20, 2014 11:56:57 AM you wrote:
>> On 5/20/2014 10:38 AM, Arup Rakshit wrote:
>>> I was following some tutorial (http://gitref.org/branching/#merge) - and
>>> doing it in my console :
>
>>
>> Because you never committed the original file to the master branch
>> before you created and switched to the change_class branch.
>>
>> You're missing
>>       git add test.rb
>>       git commit -m "initial version of test.rb"
>> before you switch branches the first time.
>
> Hum, But when I create a new branch from master, then it came to the new
> branch, but deleted from the master. Shouldn't it also not come to the new
> local branch also. That's how I expected.

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, and since you moved to a branch without that file (the 
pristine clean master branch), git removed it. (your version history 
says that change_class contains test.rb and master does not.)

-- 
.marius

  reply	other threads:[~2014-05-20 17:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 15:38 untracked file deleted from the master branch, when checked out to it from a local branch Arup Rakshit
2014-05-20 16:56 ` Marius Storm-Olsen
2014-05-20 16:03   ` Arup Rakshit
2014-05-20 17:06     ` Marius Storm-Olsen [this message]
2014-05-20 17:20       ` Arup Rakshit
2014-05-20 18:24         ` Junio C Hamano
2014-05-20 17:40           ` Arup Rakshit
2014-05-20 18:44             ` Marius Storm-Olsen
2014-05-21 10:21             ` Sergei Organov
2014-05-20 18:29         ` Marius Storm-Olsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537B8BA9.7060207@storm-olsen.com \
    --to=marius@storm-olsen.com \
    --cc=aruprakshit@rocketmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).