[git-users] Git branching does nothing

2011-10-10 Thread JP
Hi guys,

I am experiencing something very weird with my Git installation. My
setup is this:

Shared Repo on GitHub.
* I have cloned this to my local computer into master
* Using the command git branch newLogin I have created a new branch
from main called newLogin.
* Using the command git checkout newLogin I switch to the new
branch.
* I make some changes on the new branch. I do not commit or add these
changes to the staging area. I have both changed existing files and
added new files.
* Using the command git checkout master I switch back to my master
branch.

The changes I have made in the branch newLogin are visible in my
master branch. Switching branch does nothing. I would have expected to
see a master branch that did not have these changes.

If I then add these files to the staging area in master and switch
back to newLogin, git status will show exactly the same in every
branch.

What am I doing wrong? Have I completely misunderstood a very basic
concept in Git? I don't remember previous versions of Git acting like
this.

I am using Git on a Windows 7 PC.
$ git version
git version 1.7.6.msysgit.0

Thanks, JP

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Git branching does nothing

2011-10-10 Thread Jeremiah Dodds
On Mon, Oct 10, 2011 at 5:48 PM, JP jetp...@yahoo.com wrote:


 What am I doing wrong? Have I completely misunderstood a very basic
 concept in Git? I don't remember previous versions of Git acting like
 this.


As far as I know, they did. You have to commit files in the branch for
their changes to be local to the branch. IIRC, git will prevent you
from switching branches if you have staged uncommitted changes.

To save changes without committing them and switch branches, you can
use git stash, but it won't stop you from applying the stash to
whatever branch (although it does show what branch they were stashed
on).

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.