title: Git: Merge in only one commit
body: <p>Usually, I work with branches in Git, but I don't like to see hundreds of branches in my working tree (Git history). I'm wondering if there is a method in Git to "join" all commits in a branch in only one commit (ideally with a clear commit message).</p>
  
  <p>Something like this:</p>
  
  <pre><code>git checkout -b branch
  &lt;some work&gt;
  git commit -a -m "commit 1"
  &lt;some work&gt;
  git commit -a -m "commit 2"
  &lt;some work&gt;
  git commit -a -m "commit 3"
  git checkout master
  git SUPER-JOIN branch -m "super commit"
  </code></pre>
  
  <p>After this, only "super commit" will exist in the git log.</p>