title: What happens when user does "git push" before "git add" and "git commit"?
body: <p>I was working on a project made some changes in my code (in Itellij IDE) and by mistake I did below two steps in my terminal and I saw some changes went into the main respository (not my changes or anything I had worked previously).
  Does anyone know why it did it ?</p>
  
  <p>Note:
  Changes that were pushed were not my code.</p>
  
  <ol>
  <li>git pull ( all-upto-date, I received) from my terminal</li>
  <li><p>git push (rather than "git add" and "git commit") from my terminal</p>
  
  <ul>
  <li>Adding additional information (<strong>edited</strong>)
  Yes, I had some changes in my local repository before I did a git push. But when I did the mistake of "git push" none of my local committed changes were pushed but rather someone else code was pushed which I had pulled.</li>
  </ul></li>
  </ol>
  
  <p>I could not understand why git did that and thought of asking a question here to understand.</p>
  
  <p>The question was asked to know possible cause without influencing my view on the answer.</p>