title: What is the difference between squashing and deleting a commit in git?
body: <p>Suppose I do</p>
  
  <p><code>git rebase -i HEAD~3</code></p>
  
  <p>and the following opens up in a text editor:</p>
  
  <pre><code>pick ae27841 Commit 1 
  pick fd8a71e Commit 2
  pick badd490 Commit 3
  </code></pre>
  
  <p>I want to convert these 3 commits into 1 commit so I can push that commit to my repository and then call a pull request. I understand that there are 2 ways to go about this:</p>
  
  <ol>
  <li><p>I can leave one commit as <code>pick</code> and squash the other two. i.e</p>
  
  <pre><code>pick ae27841 Commit 1 
  s fd8a71e Commit 2
  s badd490 Commit 3
  </code></pre></li>
  <li><p>I can delete 2 of those 3 commits . i.e.</p>
  
  <pre><code>pick ae27841 Commit 1 
  </code></pre></li>
  </ol>
  
  <p>What is the difference between these 2 commands? As I understand it, each commit is a different version of the project. Hence my latest commit will be my latest version right? So my latest commit is all that I need to keep. Since the other 2 commits are 'older' versions of the project, I have no need for them and so I can delete them. So is method <code>2</code> the correct way to go about converting my 3 commits into one?
      If so, what kind of a case will I need to squash my commits instead? </p>
  
  <p>What is the correct way here? Squashing or deleting commits?</p>