{"thread":{"id":"22043","subject":"file in new branch also shown in master branch?","startedAt":"2009-12-28T22:37:08Z","lastAt":"2009-12-28T23:25:54Z","messageCount":2,"participants":["Carlos Santana","David Aguilar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"130428","messageId":"92c9564e0912281437g20fe51f9ta33383791ef20385@mail.gmail.com","threadId":"22043","inReplyTo":null,"subject":"file in new branch also shown in master branch?","fromName":"Carlos Santana","fromEmail":"neubyr@gmail.com","sentAt":"2009-12-28T22:37:08Z","receivedAt":"2009-12-28T22:37:08Z","isPatch":false,"sender":{"key":"neubyr@gmail.com","avatar":null},"body":"Hi,\n\nI tried following commands to test branching:\n\ngit branch test\ngit checkout test\necho \"Test branch\" >> testfile\ngit status\ngit checkout master\ngit add .\ngit commit\ngit push\n\nThe 'testfile' file shows up in 'master' as well as 'test'. I thought\nit would be seen only in test branch, but it is not so. Is it normal\nor am I missing something? I was unable to repeat same behavior again,\nso I am confused now. Any clues?\n\n-\nCS.\n"},{"id":"130429","messageId":"20091228232539.GA16146@gmail.com","threadId":"22043","inReplyTo":"92c9564e0912281437g20fe51f9ta33383791ef20385@mail.gmail.com","subject":"Re: file in new branch also shown in master branch?","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2009-12-28T23:25:54Z","receivedAt":"2009-12-28T23:25:54Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Mon, Dec 28, 2009 at 04:37:08PM -0600, Carlos Santana wrote:\n> Hi,\n> \n> I tried following commands to test branching:\n> \n> git branch test\n> git checkout test\n\n1. You are now on branch \"test\"\n\n> echo \"Test branch\" >> testfile\n> git status\n\n2. This does nothing as far as git is concerned.\n   \"testfile\" is still unknown to git.\n\n> git checkout master\n\n3. You are now on branch \"master\"\n\n> git add .\n> git commit\n\n4. You just committed \"testfile\" to branch \"master\".\n   Recall #3.  This may be where your confusion began.\n\n> The 'testfile' file shows up in 'master' as well as 'test'. I thought\n\nNope, it only shows up in master.\n\ntry:\n    git checkout test\n\nIt is gone.\n\n\n> or am I missing something? I was unable to repeat same behavior again,\n> so I am confused now. Any clues?\n\nThese are great references:\n\nhttp://book.git-scm.com/3_basic_branching_and_merging.html\nhttp://progit.org/book/ch3-0.html\n\n\nHave fun,\n\n-- \n\t\tDavid\n"}]}