I have a file on master branch, I have then created a new branch new
and wrote a few print statements. I then checkout onto master, and the same changes are on master aswell. I have not pushed the changes from new
.
How is that possible?
I have a file on master branch, I have then created a new branch new
and wrote a few print statements. I then checkout onto master, and the same changes are on master aswell. I have not pushed the changes from new
.
How is that possible?
Because most likely you have not committed your changes to the new
branch.
Rather they are just dangling around in an uncommitted, possibly unstaged state.
Type git status
to confirm this theory. Also, at any given point switch back to the new
branch via git checkout new
and then type git log
or git log -p
(-p is to view changes in the commit) to see if you have committed your work on the new
branch.