git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* untracked file deleted from the master branch, when checked out to it from a local branch
@ 2014-05-20 15:38 Arup Rakshit
  2014-05-20 16:56 ` Marius Storm-Olsen
  0 siblings, 1 reply; 10+ messages in thread
From: Arup Rakshit @ 2014-05-20 15:38 UTC (permalink / raw)
  To: git

I was following some tutorial (http://gitref.org/branching/#merge) - and doing 
it in my console :

Arup-iMac:arup_git shreyas$ git status
# On branch master
nothing to commit, working directory clean
Arup-iMac:arup_git shreyas$ touch test.rb
Arup-iMac:arup_git shreyas$ ls
git_1.txttest.rb
Arup-iMac:arup_git shreyas$ cat test.rb
Arup-iMac:arup_git shreyas$ vi test.rb
Arup-iMac:arup_git shreyas$ cat test.rb
class Foo
  def self.bar
    12
  end
end

Foo.bar
***********HERE I switched to a NEW Branch****************
Arup-iMac:arup_git shreyas$ git checkout -b change_class
Switched to a new branch 'change_class'
Arup-iMac:arup_git shreyas$ ls
git_1.txttest.rb
Arup-iMac:arup_git shreyas$ vi test.rb
Arup-iMac:arup_git shreyas$ head -1 test.rb
class Fooo
Arup-iMac:arup_git shreyas$ head -2 test.rb
class Fooo
  def self.bar
Arup-iMac:arup_git shreyas$ git commit -am 'changed the class name'
# On branch change_class
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#test.rb
nothing added to commit but untracked files present (use "git add" to track)
Arup-iMac:arup_git shreyas$ git add test.rb
Arup-iMac:arup_git shreyas$ git commit -am 'changed the class name'
[change_class 2d40033] changed the class name
 1 file changed, 7 insertions(+)
 create mode 100644 test.rb
Arup-iMac:arup_git shreyas$ cat test.rb
class Fooo
  def self.bar
    12
  end
end

Fooo.bar
Arup-iMac:arup_git shreyas$ git checkout master
Switched to branch 'master'
Arup-iMac:arup_git shreyas$ git mv test.rb ruby.rb
fatal: bad source, source=test.rb, destination=ruby.rb
Arup-iMac:arup_git shreyas$ git mv -h
usage: git mv [options] <source>... <destination>

    -v, --verbose         be verbose
    -n, --dry-run         dry run
    -f, --force           force move/rename even if target exists
    -k                    skip move/rename errors
|--------------------------------------------------------------------------------------------------------------|
********FROM MASTER BRACH WHY THE FILE test.rb DELETED?***********
Arup-iMac:arup_git shreyas$ ls
git_1.txt
Arup-iMac:arup_git shreyas$ 

-- 
===============
Regards,
Arup Rakshit

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-05-21 10:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).