git branch test git add . git checkout test git checkout master
Until you commit, you will see your working tree and your index (which refers to what you added) in both the test and master branches.
git checkout test git commit -m "files for test" git checkout master
Then you will not see in the master files that you just committed to test .
In the new branch test , a new commit (with new content) will be written, independent of master .
source share