Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15

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

From: Marius Storm-Olsen <hidden>
Date: 2016-06-15 23:01:16

On 5/20/2014 11:03 AM, Arup Rakshit wrote:
On Tuesday, May 20, 2014 11:56:57 AM you wrote:
quoted
On 5/20/2014 10:38 AM, Arup Rakshit wrote:
quoted
I was following some tutorial (http://gitref.org/branching/#merge) - and
doing it in my console :
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help