title: Pushing vs pulling
body: <h3>Background:</h3>
  
  <p>I have used Mercurial myself as a <strong>single user</strong> to keep track of the changes I make to my own code, and I think I am already familiar with the fundamentals. However, I am now about to start working on a software project with somebody else in my lab and want to make sure I understand how to properly <strong>share code</strong> with somebody else using Mercurial.</p>
  
  <p>Our situation is the following: We both have our own repository in a <strong>shared volume</strong> (i.e. different paths) in a Linux cluster, and we both have read and write access to our own and each other's repositories.</p>
  
  <p>We can call these two repositories: <strong>Bob</strong>'s and <strong>Alice</strong>'s repositories for the purpose of the discussion.</p>
  
  <p>My understanding is that there are multiple ways of having Bob and Alice share their code, two of them being the following:</p>
  
  <h3>Option 1: Sharing via pulling</h3>
  
  <ul>
  <li>Bob <strong>pulls</strong> from Alice whenever he wants to see her changes</li>
  <li>Similarly, Alice <strong>pulls</strong> from Bob whenever she wants to see his changes.</li>
  </ul>
  
  <h3>Option 2: Sharing via pushing</h3>
  
  <ul>
  <li>Bob pro-actively <strong>pushes</strong> his changes into Alice's repository whenever he wants to share his changes with her.</li>
  <li>Similarly, Alice pro-actively <strong>pushes</strong> her changes into Bob's repository whenever he wants to share his changes with her.</li>
  </ul>
  
  <h3>Questions:</h3>
  
  <p>My interpretation from reading the Mercurial documentation and tutorials online is that the first option above is usually preferred over the second one. One question I have is <strong>why?</strong></p>
  
  <p>Can the second option above lead to any problems? What would happen if Bob <strong>commits</strong> into his own repository while Alice also <strong>pushes</strong> her changes <strong>simultaneously</strong> into Bob's repository?</p>
  
  <p>Thanks</p>