I have been using Git for about a year now, but always in the master branch. I decided to try working in a branch to get experience with merging. Naturally enough, I am now observing some behaviour that I do not understand. I would appreciate any explanation of what is happening and whether this is expected behaviour or not.
I initially pull from the remote repository and then checkout -b workcopy from the master. At this point workcopy and master are identical. In workcopy I modify x.rb and y.rb. I then add/commit x.rb in workcopy. Next I checkout back to master.
From what i had read about git I believed that all the modifications that I made to x and y in workcopy only affectedi workcopy; and that those files in the master branch were still pristine as when they had been pulled. However, when I checkouted the master branch this is what I saw:
$ git co master M y.rb Switched to branch master $ $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed)