git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Carlos Santana <neubyr@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: file in new branch also shown in master branch?
Date: Mon, 28 Dec 2009 15:25:54 -0800	[thread overview]
Message-ID: <20091228232539.GA16146@gmail.com> (raw)
In-Reply-To: <92c9564e0912281437g20fe51f9ta33383791ef20385@mail.gmail.com>

On Mon, Dec 28, 2009 at 04:37:08PM -0600, Carlos Santana wrote:
> Hi,
> 
> I tried following commands to test branching:
> 
> git branch test
> git checkout test

1. You are now on branch "test"

> echo "Test branch" >> testfile
> git status

2. This does nothing as far as git is concerned.
   "testfile" is still unknown to git.

> git checkout master

3. You are now on branch "master"

> git add .
> git commit

4. You just committed "testfile" to branch "master".
   Recall #3.  This may be where your confusion began.

> The 'testfile' file shows up in 'master' as well as 'test'. I thought

Nope, it only shows up in master.

try:
    git checkout test

It is gone.


> or am I missing something? I was unable to repeat same behavior again,
> so I am confused now. Any clues?

These are great references:

http://book.git-scm.com/3_basic_branching_and_merging.html
http://progit.org/book/ch3-0.html


Have fun,

-- 
		David

      reply	other threads:[~2009-12-28 23:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-28 22:37 file in new branch also shown in master branch? Carlos Santana
2009-12-28 23:25 ` David Aguilar [this message]

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=20091228232539.GA16146@gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=neubyr@gmail.com \
    /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).