Subject: Git branches - confusing behavior

From: Dima Kagan <[email-masked]>
Date: Sun, 11 May 2008 14:31:06 +0300

Hi,

I'm currently evaluating git for doing some local work without
depending on the main subversion server. I started with the following
steps:

> git-svn clone http://svn.test.org/test/trunk
> cd trunk
> git branch test_branch
> git checkout test_branch
> vi somefile

Now, when I run 'git status' I get:
# On branch test_branch
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
#       modified:   somefile
#
no changes added to commit (use "git add" and/or "git commit -a")

This is what I expect of course. However, when I execute 'git checkout
master', I get:
M       somefile
Switched to branch "master"

And after running 'git status' on master I get:
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
#       modified:   somefile
#
no changes added to commit (use "git add" and/or "git commit -a")

Basically I see that the same file I edited on the 'test_branch'
branch appears to be modified on the 'master' branch as well. This
behavior is unwanted, of course.

Can someone please tell me, what am doing wrong? Or is this git's
normal behavior?

Thanks in advance!