I just want to clarify how committing on specific branches works.
Let's say I am working on a branch called "Metro". I make some changes to a few files, but I am not ready to push these up to the remote repository.
A hotfix comes in that I need to fix asap. I need to switch over to a clean branch called "Master", but I cannot because I would overwrite the files I have changed. I need to commit these before I can switch.
My question is, if I commit these changes on the "Metro" branch, then switch to the clean "Master" branch, will the changes made in "Metro" get pushed to the remote "Master" repo because I have committed them, even though I am pushing to another branch?
To make it succinct, are commits isolated to branches, or do all commits get added when pushing to the remote repo?