title: how do you push only some of your local git commits?
body: <p>Suppose I have 5 local commits. I want to push only 2 of them to a centralized repo (using an SVN-style workflow). How do I do this? </p>
  
  <p>This did not work: </p>
  
  <pre><code>git checkout HEAD~3  #set head to three commits ago
  git push #attempt push from that head
  </code></pre>
  
  <p>That ends up pushing all 5 local commits. </p>
  
  <p>I suppose I could do git reset to actually undo my commits, followed by git stash and then git push -- but I've already got commit messages written and files organized and I don't want to redo them. </p>
  
  <p>My feeling is that some flag passed to push or reset would work. </p>
  
  <p>If it helps, here's my git config</p>
  
  <pre><code>[ramanujan:~/myrepo/.git]$cat config 
  [core]
          repositoryformatversion = 0
          filemode = true
          bare = false
          logallrefupdates = true
  [remote "origin"]
          url = ssh://server/git/myrepo.git
          fetch = +refs/heads/*:refs/remotes/origin/*
  [branch "master"]
          remote = origin
          merge = refs/heads/master
  </code></pre>