title: Stop Mixing Up Branches in Git
body: <p>In my work, there are many independent bugs or necessary configuration changes being reported all the time. I have a copy of the repository which contains the code I need to edit to accomplish these changes. These changes are all independent of each other. I would like to be able to make changes on one branch, save them, and then switch to a different branch and work on unrelated changes without bringing the previous changes with me.</p>
  <p>I thought that this pattern was more or less what git was designed to do, but git doesn't seem to keep the branches separate. I just executed the following:</p>
  <pre><code>git checkout -b me/new-branch
  vim &lt;file&gt;
  git add &lt;file&gt;
  git commit &lt;file&gt; -m &quot;message&quot;
  git push origin me/new-branch
  </code></pre>
  <p>And the resulting PR had 3 commits in it: the newest one, and two random ones from a week ago. This is a constant problem; I can't figure out why any particular commit ends up in any particular PR. The commits being put into multiple PRs aren't necessarily the most recent ones I've been working on. I can use the same git commands three times in a row, and two of the branches I create will be &quot;clean&quot; (not include extra commits when I push them) and the third one will have multiple commits in it. I'm sure git is behaving as intended, but I have no idea what it's doing or why.</p>
  <p>Here is exactly what I am looking for:</p>
  <ol>
  <li>I'm clearly missing some very basic principle of how git works. What is it?</li>
  <li>Is there a series of git commands I can use to see if I currently have work that will follow me from one branch to another? I've been using git status but that doesn't work.</li>
  <li>What is the intended way for me to save my work on a current branch so that I can pick it up later without taking it with me when I switch to working on a different branch?</li>
  <li>How can I consistently make new branches that are just copies of main with no other changes?</li>
  </ol>