Atios Atios - 1 month ago 5x
Git Question

Git Branching, what am I doing wrong?

I am just starting with Git Branches, here's what happened:

Step 1: I initialized a Git Repository

git init

Step 2: I added and committed the "initial commit".

Step 3: I created a branch and switched to it to start developing on it (I called it

Step 4: I made some changes to the newly created

Now when I type
git status
in the
branch I see those changes that need to be committed (that's good)!

BUT when I switch to the
branch and I type
git status
I also see the changes that I made in the
branch, which those changes should only be in the (
branch, unless the branches get merged!

What am I missing here?


You need a step 5 which actually commits those changes to myproject_dev branch, otherwise those changes stay in the working tree when you check out other branches.