I am really new to git and I was trying to understand why git continues to show what I changed in one branch in another branch when I run git checkout to switch between branches. At first I tried not to add and not work using git. However, I tried using git add, but did not fix the problem. I haven't used git commit yet.
This is basically what I am doing:
$ git clone <a_repository> $ git branch * master $ git branch testing $ git checkout testing ...edit a file, add a new one, delete... $ git status
I thought that using branches, no matter what you do in one branch, it is invisible to all other branches. Isn't that the reason for creating branches?
I tried using "git add", but the changes are visible in both branches. Do I need to run git commit before switching between branches to avoid this?
git
JPZ Apr 03 2018-11-11T00: 00Z
source share